sockets: C++ server, IDL client

Discussion in 'C++' started by Holger Fleckenstein, Sep 28, 2004.

  1. 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
     
    Holger Fleckenstein, Sep 28, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pushya

    Java and Rsi IDL

    Pushya, Jun 14, 2004, in forum: Java
    Replies:
    1
    Views:
    553
    Nigel Wade
    Jun 15, 2004
  2. Ken

    ADA/C++/IDL to XML?

    Ken, Sep 5, 2003, in forum: XML
    Replies:
    0
    Views:
    659
  3. Generic Usenet Account

    IDL Vs WSDL ---- a comparison

    Generic Usenet Account, May 27, 2004, in forum: XML
    Replies:
    24
    Views:
    2,507
    Brian Kelly
    Jun 13, 2004
  4. Mike Pennington

    Looking for IDL generator.

    Mike Pennington, Oct 14, 2004, in forum: C++
    Replies:
    1
    Views:
    453
    grahamo
    Oct 14, 2004
  5. Replies:
    1
    Views:
    425
    Jonathan Mcdougall
    May 11, 2005
Loading...

Share This Page