I tried something different now, but without success yet.
After looking at which thread ids where involved I got the following

- the socket is created in one thread
- the other thread is sending data over the socket, which works like a
- the other thread then requests a close of the connection, so the
  call is within the context of the other thread.

Is this a problem? I do hope this is the reason for my problem.
Now I tried to attach the socket to the "new" thread just before calling
I got the exception then taht one cannot attach a socket which isn't
So I called DetachThread before Attach Thread, but now I get the
exception that the 
socket cannot be detached.

I have to possibilities now:
1. find out why ThreadDetach doesn't work (I hiped you could shed light
on this)
2. move the opening of the connection (thus the creation of the socket)
to the
   execute method of the thread sending. Then creating, sending and
closing will be
   within the same thread I assume.

I'd like method 1. better because the communications dll could clean up
sockets in the
finalization section if the thread/programm using the dll didn't call
properly. So it would be foolproof (nearly) I assume.


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