sockets: IDL client, C++ server [message #41168] |
Mon, 27 September 2004 16:05 |
hanswurst247
Messages: 2 Registered: September 2004
|
Junior Member |
|
|
Hi
I have written a C++ server and an IDL client, that are supposed to
communicate over sockets. Circumstances require, that only one client
can connect at a time, and possible others are refused.
So the first thing I did, was to set a short connection timeout on the
client side:
socket, lun, port, connect_timeout=1
This was only partially successful, because the server can queue a
number of clients, that are basically in a waiting loop. The number of
clients, that are queued by the server is specified in the listen()
function of <winsock2.h>:
listen(SOCKET s,int backlog)
So if I set backlog=1, I can connect with one client, another one is
queued and a third one is refused. The 3rd IDL client actually returns
after the specified 1sec realizing he couldn't connect. So far so
good.
The strange behavior starts now: even if I set backlog=0 on the C++
side, the server seems to queue one (not more) client, while servicing
another.
Now my question: is there any way on the IDL side, to make the client
realize he is only in a queue and abort?
If not, is there maybe a solution on the C++ side?
Thanks,
Holger
|
|
|