Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!unido!uklirb!incas!tsetse!zessel From: zessel@tsetse.informatik.uni-kl.de (Holger Zessel) Newsgroups: comp.unix.wizards Subject: Re: HELP! BSD select() on socket (WIN/TCP for VMS) Message-ID: <3895@incas.informatik.uni-kl.de> Date: 20 Mar 90 10:23:43 GMT References: <22789@adm.BRL.MIL> Sender: news@incas.informatik.uni-kl.de Lines: 27 TAYBENGH%NUSDISCS.BITNET@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@nusdiscs.bitnet) ---------------------------------------------------------------- Holger Zessel, uucp: ...!uunet!unido!uklirb!incas!zessel or zessel@informatik.uni-kl.de or zessel%informatik.uni-kl.de@relay.cs.net (from usa) Fachbereich Informatik, SFB124-D1 Universitaet Kaiserslautern, West-Germany