Re: [twsocket] Does a call to TWSocket.Send have to be on the same thread as the socket?
If I make a Send call to that socket, does it have to occur on the same thread as the worker thread? Or can I call it's Send method from another thread? I looked at the WSocket.pas code and I didn't see anything that looked like it wasn't thread-safe, Sending data pass thru the internal buffer which is protected by a critical section. So it should be thread safe. but I'm having some strange problems like missing OnDataAvailable() events so I wanted to check. This usually comes from bad handling of message pump. Check that part of your code. Also, don't call the message pump directly or indirectly from one of the component event ! -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- 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
[twsocket] Does a call to TWSocket.Send have to be on the same thread as the socket?
I have a TWSocket component with a background thread. I do use the Thread.Attach method as I saw in the sample code to switch it to the background thread I create, and I also set the socket's Multithreaded property to true. I also double-checked with the Delphi thread window to confirm it's doing work on a background thread. If I make a Send call to that socket, does it have to occur on the same thread as the worker thread? Or can I call it's Send method from another thread? I looked at the WSocket.pas code and I didn't see anything that looked like it wasn't thread-safe, but I'm having some strange problems like missing OnDataAvailable() events so I wanted to check. Thanks, Robert -- 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