I'm an EE Student working on a project involving modification of example code for Raw LWIP HTTP Server. I can repeatedly send the same packet when I reset the board because it sets up one TCP connection and sends one packet. However, since I've modified it to perform this same type of behavior on a btn press (rather than reset btn), it is able to send 4 packets, then I don't get the 2nd receive event (from the server closing the connection).
I've been informed by a knowing person that I'm supposed to create a State machine to keep track of the pcb state. Is that true? I just want to send one packet per tcp connection. I wait until the server closes to call tcp_close() but it seems there might be a timing issue because I receive some acks late.
Using the LWIP_DEBUG functionality with the TCP_Options enabled, I have the log for the 4 tcp connections from the 4 btn presses.
I am including a link to the file showing the log. I have a very basic understanding of TCP and internet stuff, so I marked it up to try to find patterns.
Can someone look at my log and tell me what they think?
Do I need to use the poll() event? I also don't do anything in my errorHandler. Should I? Do I need a state machine to keep track of a single tcp_pcb?
link to log is below(filename: TCP Debug Feature.mht).
http://s000.tinyupload.com/?file_id=06484156254841729160