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