A
AMercer
When a client thread calls Connect, it blocks until the connection is made.
If the server is busy, the client will block until the server is no longer
busy (ie until the server calls WaitForConnection). If the server is not
running (ie the pipe does not exist), the client side still blocks. I have
tested this - run the client, observe that it blocks, run the server, the
client unblocks, and the pipe transaction runs to completion.
Ok, I understand it, but I don't like it because my client thread can block
indefinitely. Thus, I can't use my gui thread to do pipe operations because
my gui app will go unresponsive if it blocks connecting to a pipe. So, I
need to go async or launch threads, and now I may have multiple threads
blocked indefinitely and no way to know what is going on.
What I need is a timeout on the Connect, and I need status information
available to the client about the pipe before the connect is attempted. Does
anyone have any bright ideas on this issue?
If the server is busy, the client will block until the server is no longer
busy (ie until the server calls WaitForConnection). If the server is not
running (ie the pipe does not exist), the client side still blocks. I have
tested this - run the client, observe that it blocks, run the server, the
client unblocks, and the pipe transaction runs to completion.
Ok, I understand it, but I don't like it because my client thread can block
indefinitely. Thus, I can't use my gui thread to do pipe operations because
my gui app will go unresponsive if it blocks connecting to a pipe. So, I
need to go async or launch threads, and now I may have multiple threads
blocked indefinitely and no way to know what is going on.
What I need is a timeout on the Connect, and I need status information
available to the client about the pipe before the connect is attempted. Does
anyone have any bright ideas on this issue?