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

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
>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.
>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
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] 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] 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] Suggestion: set FLastError on session connect/disconnect

2011-07-06 Thread Arno Garrels
Anton S. wrote: > I now trying to implement sync socket actions (I'll need to make DLL > so async model doesn't fit). 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

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

2011-07-06 Thread Anton S.
Hmm, things appeared not so simple as they seemed. Assigning LastError on both session connect and disconnect immediately rewrites connection error code with 0 caused by successful close. Currently I have no nice idea but maybe someone has? -- Anton -- To unsubscribe or change your settings fo