Hello, sorry, pressed the wrong button.
I had changed the code now so that the socket is created within the context of the thread (veryfied by GetCurrentThreadID) at start of execute and closing is initiated at the end of execute (same threadID). In the communication DLL (not the one which contains the thread but the one who makes all ICS calls) I have output the ThreadID as well in the line before that shutdown call. It is all the same threadID, but he doesn't reach OnSessionClosed! Neither the output file it would create nor a breakpoint set on it is reached! Before lunch I had 2 time succes, but now the app. hangs again with no obvious reason! What can this be... It's like this now: - communication dll sets up one dedicated socket for receiving data - communication dll sets up a thread for message polling for the other components - the packet handling dll creates a thread - the packet handling dll initiates a socket connection within the execute method of that created thread - the PID of the thread is noted - some data is sen via this connection (works) - some data is received via the dedicated connection (works) - the packet handling dll terminates the tread and initiates the close of the socket connection it created via. - Shutdown is as follows: - the PID is noted - Socket.shutdown(1); - Socket.processMessages; -> one never gets into OnSessionClosed. Why? Greetings Markus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be