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

2006-02-03 Thread Francois PIETTE
> - Shutdown is as follows: > - the PID is noted > - Socket.shutdown(1); > - Socket.processMessages; > > -> one never gets into OnSessionClosed. Why? Because the message pump is not properly called. ProcessMessages is not equivalent to the message loop. It just process messages already in the qu

Re: [twsocket] closing socket socket

2006-02-03 Thread Francois PIETTE
>> > So I called DetachThread before Attach Thread, but now I get the >> > exception that the socket cannot be detached. >> >> You can detach a socket from a thread only when you call >> ThreadDetach within the same thread context >> which called TreadAttach (or the creating thread context if >> no

Re: [twsocket] still problems with terminating the socket

2006-02-03 Thread Francois PIETTE
>Assign all properties and events >.. >Wsocket.Send(something); >Wsocket.MessageLoop; I like to put the initialization stuff into a custom message handler (i.e. WM_THREAD_STARTUP). So just before calling MessageLoop, I post a custom message to the thread and from

Re: [twsocket] THttpConnection.SendStream at defined Streamoffset

2006-02-03 Thread Francois PIETTE
Is your problem handling byte range with dynamic content ? -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: "Joachim Taubitz" <[EMAIL PROTECTED]> To: Sent: Friday, February 03, 2006 11:39 AM Subject: [twsocket] THttpConnection.SendStream at defined Streamoffset >

[twsocket] Remember the SetWindowLong bug in WSocket?

2006-02-03 Thread Fastream Technologies
Hello, That bug caused a lot of frustration here. Now the problem is resolved for FTP and web servers with my fix BUT for the reverse proxy, there is a window leakage that cannot be detected by CodeGuard. It seems the problem is in THttpCli destructor. XWindowDealloc returns true but I have BIG

Re: [twsocket] Async ICMP

2006-02-03 Thread Guillaume MAISON
Fastream Technologies a écrit : > Hello, > > I want to ping a list of servers (in parallel if possible) but without > threads, in the main thread. Currently I have some IdICMP code and when I am > disconnected from a host, it stalls for the timeout period. Is async ICMP > possible with ICS? If

[twsocket] Async ICMP

2006-02-03 Thread Fastream Technologies
Hello, I want to ping a list of servers (in parallel if possible) but without threads, in the main thread. Currently I have some IdICMP code and when I am disconnected from a host, it stalls for the timeout period. Is async ICMP possible with ICS? If not, is there an API limitation for this (be

[twsocket] Sockets and my dll

2006-02-03 Thread Markus Humm
Hello, it seems that I need a rewrite of this part of my project from start on. The idea is to have one dll for encapsulating all communication stuff and another sitting on top of it for handling of my special protocolls. because I have more than one I can exchange these dlls sitting in top as ne

Re: [twsocket] Closing socket

2006-02-03 Thread Wilfried Mestdagh
Hello Markus, > after calling shutdown, do I need to poll windows messages? > If yes, how to do it properly and in such a way that it only > polls as long as needed? You have to have a running message pump in the Execute method of the thread as Arno has showed. In OnSessionClosed you may post a

[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

[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] closing socket socket

2006-02-03 Thread Humm, Markus
> -Ursprüngliche Nachricht- > Von: Francois Piette [mailto:[EMAIL PROTECTED] > Gesendet: Freitag, 3. Februar 2006 11:21 > An: ICS support mailing > Betreff: Re: [twsocket] closing socket socket > > > > So I called DetachThread before Attach Thread, but now I get the > > exception that t

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

[twsocket] THttpConnection.SendStream at defined Streamoffset

2006-02-03 Thread Joachim Taubitz
Hello, i am a german guy who wants to create a UPnP MediaServer Application for my D-Link DSM320 UPnP Streaming Client. For this i use your ICS Components. On my Way to create my App. there was one problem 1. At beginning of streaming MediaContent like a MPEG-File, the DSM320 send

Re: [twsocket] closing socket socket

2006-02-03 Thread Arno Garrels
Humm, Markus wrote: > Now I tried to attach the socket to the "new" thread just before calling > shutdown. > I got the exception then taht one cannot attach a socket which isn't > detached. > So I called DetachThread before Attach Thread, but now I get the > exception that the > socket cannot be de

Re: [twsocket] closing socket socket

2006-02-03 Thread Francois Piette
> So I called DetachThread before Attach Thread, but now I get the > exception that the socket cannot be detached. You can detach a socket from a thread only when you call ThreadDetach within the same thread context which called TreadAttach (or the creating thread context if no attach has been d

[twsocket] Closing socket

2006-02-03 Thread Humm, Markus
Hello again, one more thought: after calling shutdown, do I need to poll windows messages? If yes, how to do it properly and in such a way that it only polls as long as needed? At the time the socket is closed there is another thread which only polls messages. Is this enough? Greetings Marku

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

[twsocket] closing socket socket

2006-02-03 Thread Humm, Markus
Hello, I tried something different now, but without success yet. After looking at which thread ids where involved I got the following results: - the socket is created in one thread - the other thread is sending data over the socket, which works like a charm - the other thread then requests a clos

Re: [twsocket] wilfried mestdagh sockspy query

2006-02-03 Thread Wilfried Mestdagh
Hello, You can use OnSessionConnected. In that event you can send your autorisation string. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, February 3, 2006, 04:22, [EMAIL PROTECTED] wrote: > hi > this question is about your socketsp

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