I've got the following problem and look for the real cause:
(don't know yet whether TWSocket is involved or not, but looks like)

I've a dll with a message pumping thread and at least one sending 
TWSocket and one seperate receiving TWSocket.

The very same DLL provides also other communication ports (e.g. RS232).
I've written several test programs now, two of the tree work fine, the 
third now crashes when closing it, but only when the UDP-Sockets 
communication method is tested for e.g. RS232 it works fine.

The other two test app.s are one which loads the dll via load library,
the other one statically (external...) and is DUnit based. They both work fine.

The crashing test program uses one thread per connection (mostly not necessary 
for TWSocket but since paralellization is wanted and to be tested I implemented 
it this way) and a seperate thread which queries the others to build some 
figures and display them via Synchronize on the screen. It uses the DLL 

When the program ends, all connections are closed and the DLL has a procedure 
shutdown which closes the message pumping thread and all open connections if 

Now the question: how are TWSockets closed properly? I've derrived a class from 
and overridden OnSessionClosed so that a flag is set when it occured.
When closing the socket I call now this:

run a loop until either this flag is set or a timeout coccurs.

Is this the correct way? And how long to wait?
The message pumping thread is closed after closing all sessions.


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

Reply via email to