Re: [twsocket] still problems with terminating the socket

2006-02-03 Thread Francois PIETTE
ead and from the corresponding event handler, I do all initialization stuff. -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: "Arno Garrels" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Friday, February 03, 2006 1:11 PM Subje

[twsocket] still problems with terminating the socket

2006-02-03 Thread Humm, Markus
Hello, 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 contains the thread but the one who

Re: [twsocket] still problems with terminating the socket

2006-02-03 Thread Arno Garrels
Last sample was with TWSocket's built in message pump. Instead you can write your own, something like this: procedure TMyThread.PumpMessages(WaitForMessages: Boolean); var HasMessage : Boolean; Msg: TMsg; MsgRec : TMessage; begin while TRUE do begin if Terminate

Re: [twsocket] still problems with terminating the socket

2006-02-03 Thread Arno Garrels
Or better try something like this (not tested) procedure TMyThread.Execute; begin prepare the data to be sent Wsocket := TWsocket.Create(nil); try Assign all properties and events .. Wsocket.Send(something); Wsocket.MessageLoop; finally WSock

Re: [twsocket] still problems with terminating the socket

2006-02-03 Thread Arno Garrels
Humm, Markus wrote: > > How would I implement a good message pump in that thread? For instance (not tested) procedure TMyThread.Execute; begin prepare the data to be sent Wsocket.Create() Assign all properties .. Wsocket.Send(something); Wsocket.MessageLoop; .. cl

Re: [twsocket] still problems with terminating the socket

2006-02-03 Thread Humm, Markus
> Hello Markus, > > > Okay, exception can be ruled out, the shutdown call is within try / > > except and > > I have a output in the except clause showing the exception. > This doesn't > > fire. > > There is something wrong that we cannot see. Consider one of your > previous mails: > > > - outp

Re: [twsocket] still problems with terminating the socket

2006-02-03 Thread Humm, Markus
Hello, after moving the creation of the sockets in the execute method of the thread which sends and initiates the closing of the communication channel the thing closed like a charm! Now there is only the problem if the communication doesn't close and the communication dll tries to close the stil

Re: [twsocket] still problems with terminating the socket

2006-02-03 Thread Wilfried Mestdagh
Hello Markus, > Okay, exception can be ruled out, the shutdown call is within try / > except and > I have a output in the except clause showing the exception. This doesn't > fire. There is something wrong that we cannot see. Consider one of your previous mails: > - output a debug message to eve

Re: [twsocket] still problems with terminating the socket

2006-02-03 Thread Arno Garrels
Humm, Markus wrote: > Hello, > >> Hello Markus, >> >>> I put some debug output in my OnSessionCLosed handler, it doesn't seem >>> to be called. But I haven't yet debugged. >> >> See my other reply. If it is not fired, then eather ShutDown did not >> work because of some exception error, or eathe

Re: [twsocket] still problems with terminating the socket

2006-02-02 Thread Humm, Markus
Hello, > Hello Markus, > > > I put some debug output in my OnSessionCLosed handler, it > doesn't seem to be called. > > But I haven't yet debugged. > > See my other reply. If it is not fired, then eather ShutDown did not > work because of some exception error, or eather the message > pump of t

Re: [twsocket] still problems with terminating the socket

2006-02-02 Thread Wilfried Mestdagh
Hello Markus, > I will check next the thread ids as recommendet by somebody else. Also you need to check if the message pump is working in the right thread context. So you best check over there too. This because you mention that OnClose is never fired. I think I forgot to say that in my previous

Re: [twsocket] still problems with terminating the socket

2006-02-02 Thread Francois PIETTE
> thanks for clarification. It doesn't matter that the one thread which > communicates via TWSocket doesn't reside in the same DLL as the TWSocket > created? A thread is not located in a DLL or in an exe. A thread is independent on where the code is ! Putting a method into a TThread class doesn't

Re: [twsocket] still problems with terminating the socket

2006-02-02 Thread Francois PIETTE
utdown to complete is probably much much too short ! -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: "Humm, Markus" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Thursday, February 02, 2006 2:24 PM Subject: Re: [twsocket] still prob

Re: [twsocket] still problems with terminating the socket

2006-02-02 Thread Humm, Markus
> Hello Markus, > > Seems you don't get the Event-driven way of programming, why a loop of > 100ms that seems to do nothing with event it could receive ? > > HM> - output a debug message to eventlog > HM> - socket.shutdown(1); > HM> - output a 2nd message to eventlog > HM> - do this: > HM> t:=G

Re: [twsocket] still problems with terminating the socket

2006-02-02 Thread Wilfried Mestdagh
Hello Markus, > I put some debug output in my OnSessionCLosed handler, it doesn't seem to be > called. > But I haven't yet debugged. See my other reply. If it is not fired, then eather ShutDown did not work because of some exception error, or eather the message pump of the thread where TWSocket

[twsocket] still problems with terminating the socket

2006-02-02 Thread Humm, Markus
Hello, I put some debug output in my OnSessionCLosed handler, it doesn't seem to be called. But I haven't yet debugged. Greetings Markus Humm -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at ht

Re: [twsocket] still problems with terminating the socket

2006-02-02 Thread Dod
Hello Markus, Seems you don't get the Event-driven way of programming, why a loop of 100ms that seems to do nothing with event it could receive ? HM> - output a debug message to eventlog HM> - socket.shutdown(1); HM> - output a 2nd message to eventlog HM> - do this: HM> t:=GetTickCount; HM> w

[twsocket] still problems with terminating the socket

2006-02-02 Thread Humm, Markus
Hello, I did some changes now (I will onl make changes to my communication dll which don't affect the other communication methods). I derrived a descendant from TWSocket which implements the OnSessionClosed method and overrides create to assign my OnSessionClosed variant to the property. In my