HELP! BSD select() on socket (WIN/TCP for VMS)

Holger Zessel zessel at tsetse.informatik.uni-kl.de
Tue Mar 20 20:23:43 AEST 1990


TAYBENGH%NUSDISCS.BITNET at cunyvm.cuny.edu writes:

 >select() takes in NULL pointer for writefds/exceptfds, but I always encounter
 >access violation run-time error when I tried to call

 >        select(n, readfds, 0, 0, &timeout);
You may have forgotten the & in front of readfds ?

 >Moreover, select() supposed to block or return depend on the timeval (timeout)
 >passed in, but it always return immediately no matter what timeout value I
 >gives without setting any fle descriptors (channels). For example,

 >        if (nfd = (select(sock+1, &ready, &write, &except, &timeout)) <0)
 >           perror("select");
Just take a very sharp look at the code and especially the parentheses.
 < has a higher priority than =
->
       if ((nfd = select(sock+1, &ready, &write, &except, &timeout)) <0)
          perror("select");

 >-Beng Hang (taybengh at nusdiscs.bitnet)
----------------------------------------------------------------
Holger Zessel, uucp: ...!uunet!unido!uklirb!incas!zessel
	or	zessel at informatik.uni-kl.de
	or	zessel%informatik.uni-kl.de at relay.cs.net (from usa)
Fachbereich Informatik, SFB124-D1
Universitaet Kaiserslautern, West-Germany



More information about the Comp.unix.wizards mailing list