Markus Humm wrote: > > My application now has to tell the communication part (means the > > server side of the TWSocket connection) to shut down. it sends him a > > binary shutdown command and after a short time the client does a > > shutdown(1) on the socket. > > There's most likely something wrong in your application logic. > When the server receives your custom shutdown command it should stop > listening first, send an OK-response back to the requesting client and > disconnect all client connections. > > On the client-side after sending your custom shutdown command, > receive the OK response and subsequently either Close the connection > actively or wait for the server to close the connection. However with > "wait" I do of course _not_ mean "wait in some loop", OnSessionClosed > fire on connection close. >
That might be a option, but I'm not yet fully convinced. How long may it take to send a short message to localhost and receive it on the other side? I mean if a message loop of 3 sec. doesn't give him enough time why should the change of logic be better? Another related question: are there two logical channels in the background of TCP, one for sending the actual data and one for signalling the close? Otherwise I cannot explain myself why the data doesn't arrive but the close does. Greetings Markus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be