RE: {simple} sockets socket.Receive question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UmFqbmk=?=

    RE: {simple} sockets socket.Receive question

    Dear Sir/Mam,

    I have written a server code using the Windows Socket API's. Wherein I have
    created the socket and bound it to a particular IP address and port number.
    Later I have made the socket in non-blocking mode by using the proper socket
    option ( i.e. SO_RCVTIMEO). After which with the use of recv() I am trying to
    get into the receive mode. Here as the receive time out is being used the
    socket should come out of the block mode after the time out value. But this
    is not happening here, instead the socket is always in the blocking mode.

    I am facing this kind of an issue only on few of the VISTA systems. Whereas
    on few other VISTA systems it is working fine (means we are ableto switch
    between block and non-block modes).
    But there is no problem on any of the XP systems.

    Could you please provide me with information related to this and help in
    deriving a proper conclusion.

    Thanks in advance,
    Rajni

    "War Eagle" wrote:
    clientSocket.Re ceive(PreRxBuff er, 0,4, 0);
    >
    Does this function block? What happens if the client only sends 3 bytes? What if the client sends 5 bytes or 5000 bytes?
    >
    >
    >
  • Peter Duniho

    #2
    Re: {simple} sockets socket.Receive question

    On Wed, 17 Sep 2008 21:56:00 -0700, Rajni
    <Rajni@discussi ons.microsoft.c omwrote:
    I have written a server code using the Windows Socket API's. Wherein I
    have
    created the socket and bound it to a particular IP address and port
    number.
    Later I have made the socket in non-blocking mode by using the proper
    socket
    option ( i.e. SO_RCVTIMEO). [...]
    1. You only need to post the question once.

    2. Your question appears to have nothing to do with .NET or C#. Rather
    than hijacking a previous thread in this newsgroup that _was_ related to
    ..NET, you may prefer to post your question in one of the Winsock
    newsgroups (i.e alt.winsock.pro gramming or
    comp.os.ms-windows.program mer.tools.winso ck).

    3. The SO_RCVTIMEO socket option controls the timeout for receives, not
    the blocking state of the socket. If you want to set the socket to
    non-blocking, use ioctlsocket() or WSAIoctl() with the FIONBIO option.

    Pete

    Comment

    Working...