Re: [twsocket] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Francois PIETTE
I now trying to implement sync socket actions (I'll need to make DLL so async model doesn't fit). procedure TSockClient.Request; begin if State <> wsConnected then begin Connect; while not (State in [wsConnected, wsClosed]) do MessagePump; if State <> wsConnected then begin

Re: [twsocket] Creatively annoying a host

2011-07-07 Thread Angus Robertson - Magenta Systems Ltd
> *Subject:* Re: [twsocket] Creatively annoying a host > > I could leave the connection open without sending a response? > > > Just delay the answer for a couple second, this will slow down the > probing. I think keeping the client connection open as long as possible, sending random HTTP headers

Re: [twsocket] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Anton S.
2Arno: >No problem to use async in a DLL, have a look at OverbyteIcsDll1 demo, >it shows a multi-thread capable implementation. If you don't need MT >have a look at the console demos, those with "con" in name, the same >princple works in a DLL as well. Thanks! I digged into OverbyteIcsDll1 demo an

Re: [twsocket] Creatively annoying a host

2011-07-07 Thread Anton S.
>I could leave the connection open without sending a response? You may delay it for, say, 5 sec. But then I guess the vulnerability to DDOS increases (thousands of connections simultaneously). I'm not sure how much of them is possible. >Or send a vast amount of rubbish data in response? Maybe — i

Re: [twsocket] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Francois PIETTE
2Arno: No problem to use async in a DLL, have a look at OverbyteIcsDll1 demo, it shows a multi-thread capable implementation. If you don't need MT have a look at the console demos, those with "con" in name, the same princple works in a DLL as well. Thanks! I digged into OverbyteIcsDll1 demo and g

Re: [twsocket] Creatively annoying a host

2011-07-07 Thread Francois PIETTE
>I could leave the connection open without sending a response? You may delay it for, say, 5 sec. But then I guess the vulnerability to DDOS increases (thousands of connections simultaneously). I'm not sure how much of them is possible. Well, this is possible, depending on how their are organiz

Re: [twsocket] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Anton S.
>You get the best isolation from >the host application by creating a worker thread and run most of your code >in the context of this thread. Okay, I think I got the structure which seems correct. As I need several sockets for several purposes, I can't use socket's message loop (I don't want to c

Re: [twsocket] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Francois PIETTE
>You get the best isolation from the host application by creating a worker thread and run most of your code in the context of this thread. Okay, I think I got the structure which seems correct. As I need several sockets for several purposes, I can't use socket's message loop (I don't want to cr

Re: [twsocket] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Anton S.
>I think you should use only one thread for all socket operation within your application and one thread for each lengthy processing/computation you have to do. The rule is to avoid lengthy processing within the thread doing communication. Yes, that's exactly I intended to do except I don't need

Re: [twsocket] Suggestion: set FLastError on session connect/disconnect

2011-07-07 Thread Francois PIETTE
See above. Pausing/resuming the socket shouldn't be used, specially if you have your own worker thread. Just have the socket event handler blocked waiting for some synchronization object. You mean blocking the entire message loop? Yes, indeed. If you don't want any socket event while outside o

[twsocket] Hang in TIcsWndControl.ProcessMessages

2011-07-07 Thread Eugene Kotlyarov
Hi Everyone Does anyone have ideas why TIcsWndControl.ProcessMessages could hang sometimes when socket is used in separate thread? -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http:/

Re: [twsocket] Hang in TIcsWndControl.ProcessMessages

2011-07-07 Thread Francois PIETTE
Does anyone have ideas why TIcsWndControl.ProcessMessages could hang sometimes when socket is used in separate thread? Have you followed the rules: create TWSocket within the thread's execute method OR call ThreadAttach ? -- francois.pie...@overbyte.be The author of the freeware multi-tier mi

Re: [twsocket] Hang in TIcsWndControl.ProcessMessages

2011-07-07 Thread Eugene Kotlyarov
>> Does anyone have ideas why TIcsWndControl.ProcessMessages could >> hang sometimes when socket is used in separate thread? >Have you followed the rules: create TWSocket within the thread's execute >method OR call ThreadAttach ? Yes socket is created within threads execute method, and it works