delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/10/05/15:48:18

From: weng AT tp-cad DOT com (Matthias Weng)
Subject: select() returns 0 (NT4.0)
5 Oct 1998 15:48:18 -0700 :
Message-ID: <3618D85D.848DD2AB.cygnus.gnu-win32@tp-cad.com>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hi there,
I'm using B19.1 under NT4.0. When I try to connect multiple clients to
one server- application via TCP/IP the server blocks in a REPEAT command
because select returns 0 though rhere is a client that wants to
communicate with the server. This happens though the bitmask for reading
contains a value different from zero.
Additional to that, each client after the second one who tries to get a
connection to the server is connected to the same socket as the second
client, so recv() tries to read from the second clients socket and
blocks until the second client does some action.
This application runs without problems under several unix systems since
many years.
Who can help me with this ??

-- Matthias Weng

 struct timeval nulltime;
 int     res, n, peer, user = null;
 fd_set  fd_var, fd_read, fd_write, fd_except;



   FD_ZERO(&fd_var);
   FD_ZERO(&fd_read);

  ... Initialization of fd_var ...


   REPEAT
    memcpy (&fd_read, &fd_var, sizeof (fd_read));
    FD_ZERO(&fd_write);
    FD_ZERO(&fd_except);

    /* hier werden die ports abgefragt, ob etwas vorhanden ist ! wb */

    memset (&nulltime, 0,sizeof(nulltime));
    res = select(sizeof(fd_var), &fd_read, &fd_write, &fd_except,
&nulltime);

   UNTIL (res);





-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019