C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sockets: C++ server, IDL client

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Holger Fleckenstein
Guest





PostPosted: Tue Sep 28, 2004 3:39 pm    Post subject: sockets: C++ server, IDL client Reply with quote



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 (IDL) 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 (C++) 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: how do I get the server to not keep any client in the
waiting queue?

If there is no solution on the C++ side, is there any way on the IDL
side, to make the client realize he is only in a queue and abort?

Thanks,
Holger
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.