[twsocket] Problems with TWSocket.close and DLL

2006-01-31 Thread Humm, Markus
Hello, I'm writing a application in D2006 and build a communication dll for it. The communications dll encapsulates different communication methods (for USB, ethernet...). Ethernet communication is done via ICS TWSocket, the version included on the partner cd. The DLL has a data module which ha

[twsocket] Problems with TWSocket.close and DLL

2006-02-01 Thread Humm, Markus
> > > 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 wh

[twsocket] Problems with TWSocket.close and DLL

2006-02-03 Thread Humm, Markus
Hello, sorry, pressed the wrong button. I had changed the code now so that the socket is created within the context of the thread (veryfied by GetCurrentThreadID) at start of execute and closing is initiated at the end of execute (same threadID). In the communication DLL (not the one which co

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 TObjectL

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 connexi

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-inven

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 sepera

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 this

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 Arno Garrels
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 run in the

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

2006-02-01 Thread Francois Piette
ry 01, 2006 11:45 AM Subject: Re: [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 proble

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 soc

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

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 >> >> >

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 t

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 TWS

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

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 go

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 e

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

2006-02-02 Thread Humm, Markus
Hello, > 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, > experi

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 processin

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

2006-02-03 Thread Francois PIETTE
ng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: "Humm, Markus" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Friday, February 03, 2006 2:06 PM Subject: [twsocket] Problems with TWSocket.close and DLL > Hello, > >