On Thu, 2010-08-19 at 17:36 -0400, shogun wrote: > I have some extra stuff I more or less removed in the structure > "mainNetInfoStruct" but ignore that. mainNetInfoStruct does however > contain > the pointer to the PCB in the accept callback to be used later for > sending. > The question is about what to do after a send error and if I "reset" > the > socket correctly after the error. The goal is to have the socket > close and > allow the client to reconnect. Below is the header and the source > code more > or less. Also, thanks for helping me out with this! I am sort of new > to > this and appreciate the help and advice.
I would delete most of the stuff in main_client_close() and just have it call tcp_close(). This will allow any pending sends to be sent and clean up a bit more gracefully. I don't like the way that the listening PCB (the one returned by tcp_listen()) isn't stored anywhere - you can never close this PCB without a handle on it, but perhaps you never need to. It looks to me though like if the other end tries to reconnect after the connection has been closed then you should be fine. What do you see happen in this case? Kieran _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
