Markus Humm wrote:
> 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?

It depends. If blocking tasks are executed at that moment no window 
messages can be processed and no data can be received. If server and
client are running in the same thread context one blocking task is 
enough to block both client and server I/O.
> I mean if a message loop of 3 sec. doesn't give him enough time 

Possibly the message loop isn't implemented properly? 
Please show us some code.

> why should the change of logic be better?

Dunno, it's just how I would do it, following a simple request/response

Arno Garrels
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to