Re: [twsocket] Connecting and sending in a thread

2005-09-22 Thread Francois Piette
> To clarify what Francois said, you could have a thread that does that > processing, and posts messages back to your main form with the data, which > then calls WSocket.Send to send that data. Then you don't have to worry > about multithreaded sockets. This result in a better programming model w

Re: [twsocket] Connecting and sending in a thread

2005-09-22 Thread Dan
- Original Message - From: "Jacco Bezemer" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Thursday, September 22, 2005 10:30 AM Subject: Re: [twsocket] Connecting and sending in a thread > Helo Francois and Wilfried, > > Thanks for your tip

Re: [twsocket] Connecting and sending in a thread

2005-09-22 Thread Francois Piette
> I think I need to do this in a thread because the send > operation takes a long time. Sending is fully asynchronous, no need for thread there. > This due to the fact that retrieving the data, formatting > it into XML and sending it eventually is in a loop > and is not event driven. Retrievi

Re: [twsocket] Connecting and sending in a thread

2005-09-22 Thread Jacco Bezemer
Helo Francois and Wilfried, Thanks for your tips. I managed to get it working in a single thread. I think I need to do this in a thread because the send operation takes a long time. This due to the fact that retrieving the data, formatting it into XML and sending it eventually is in a loop and is

Re: [twsocket] Connecting and sending in a thread

2005-09-21 Thread Francois PIETTE
> I'm not that familair with building multi-threaded applications, I > gave it a try but I didn't get it working. When I connect in the main > thread and create a thread in the onsessionconnect event, it works. > But when I terminate the thread and want to reconnect in the main > thread, I get a Wi

Re: [twsocket] Connecting and sending in a thread

2005-09-21 Thread Wilfried Mestdagh
Hello Jacco, > I'm not that familair with building multi-threaded applications, I But are you sure you neec multi threading ? Can you give reason wy you think it should be or tell something more about your application. You can easy have honderts of connections running in 1 thread (main thread).

Re: [twsocket] Connecting and sending in a thread

2005-09-21 Thread Jacco Bezemer
Hi Wilfried, I'm not that familair with building multi-threaded applications, I gave it a try but I didn't get it working. When I connect in the main thread and create a thread in the onsessionconnect event, it works. But when I terminate the thread and want to reconnect in the main thread, I get

Re: [twsocket] Connecting and sending in a thread

2005-09-21 Thread Wilfried Mestdagh
Hello Jacco, There is no difference if you wants to do in a thread if all your code is thread safe, and you need a message pump in the thread. The most easy way is to develop / test all in main thread, so that you know that eventually bugs are not because of threaded code bugs. To do so you make