Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-02 Thread Sargent Jeremy
Hi Marcus, I've been following your problem and I believe that the problem you have is because you are trying to use a dll with only a little multi-threading experience. One of the reasons people avoid threads is that it requires a lot of reading, development time, experience and when something

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-02 Thread Wilfried Mestdagh
Hello Markus, How can I solve my problem? Which thread does the socket belon to now? Does it belong to the thread in Use GetCurrentThreadID to find out the thread context of the code. Check this where the TWSocket is created and where you Destroy it. Check this also in some of the TWSocket

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-02 Thread Francois PIETTE
Yes because you don't need threads with ICS :) you can easily exchange data with multiple concurent at the same time. Yes I can, I know. But that doesn't multiply my capacity for simultaniously processing the packets. I split it up into this threaded scenario because data processing of the

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Francois Piette
The DLL has a data module which has one single TWSocket for all incomming data and for each outgoing connection a TWSocket is created dynamically. The instance of this socket is stored in a TObjectList together with other relevant information. When the first connection is opened a seperate

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Humm, Markus
Hello, to the socket hanging on close. There are different threads involved. The communication dll has one thread which only polls messages. That one shouldn't be the problem. The dll using that communication dll has one thread per socket (max. at most 10). Freing the socket is requested by

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Dod
Hello Markus, Why do you use one thread per socket ? TSWocket is event driven so you can connect to 500 servers if you want within same thread. For polling messages, if you .mulithread:=true then the TWSocket will create its own message queue. HM Hello, HM to the socket hanging on close. HM

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Francois Piette
: [twsocket] Problems with TWSocket.close and DLL Hello, to the socket hanging on close. There are different threads involved. The communication dll has one thread which only polls messages. That one shouldn't be the problem. The dll using that communication dll has one thread per socket

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Humm, Markus
-Ursprungliche Nachricht- Von: Dod [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 1. Februar 2006 12:02 An: ICS support mailing Betreff: Re: [twsocket] Problems with TWSocket.close and DLL Hello Markus, Why do you use one thread per socket ? TSWocket is event driven so you

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Humm, Markus
-Urspr√ľngliche Nachricht- Von: Arno Garrels [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 1. Februar 2006 12:10 An: ICS support mailing Betreff: Re: [twsocket] Problems with TWSocket.close and DLL Humm, Markus wrote: The dll using that communication dll has one thread per

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Arno Garrels
Humm, Markus wrote: -Urspr√ľngliche Nachricht- Von: Arno Garrels [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 1. Februar 2006 12:10 An: ICS support mailing Betreff: Re: [twsocket] Problems with TWSocket.close and DLL Humm, Markus wrote: The dll using that communication dll has

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Francois Piette
And the socket has been _created in method execute as well? How do you achieve that client sockets run in the client thread if not using ThreadAttach/ThreadDetach? Hm, no it is created before execute. And no thread attach/detach is used. It works so far until the point when I try to close

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Wilfried Mestdagh
Hello Markus, This is done because each thread does more things than just sending receiving. The message was meant because many people think they need a thread per communication TWSocket channel. So I assume you have your own reason to have a thread. What you can do is Create and destroy

Re: [twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Humm, Markus
Humm, Markus wrote: The dll using that communication dll has one thread per socket (max. at most 10). Freing the socket is requested by this dll when it's execute method terminates. And the socket has been _created in method execute as well? How do you achieve that client sockets

Re: [twsocket] Problems with TWSocket.close and DLL

2006-01-31 Thread Dod
Hello Markus, Why not .free the socket thru a message sent in .OnClose event ? This is a better way than doing a sleep(x) that tends to defeat asynchronous ICS model, you' better thing in term of events. Also you could not free you TWSocket but re-use later as you maintain a

Re: [twsocket] Problems with TWSocket.close and DLL

2006-01-31 Thread Dod
Hello, Think that ICS is fully asynchronous and event driven, it's a different approach comparing to Indy or other Socket components and also comparaing to RS232 programming where synchronous mode is usual. With ICS (server or client mode) you can make or receive thousand of

Re: [twsocket] Problems with TWSocket.close and DLL

2006-01-31 Thread Arno Garrels
Humm, Markus wrote: The DLL has a data module which has one single TWSocket for all incomming data and for each outgoing connection a TWSocket is created dynamically. The instance of this socket is stored in a TObjectList together with other relevant information. Sounds like you re-invented