non-blocking accept on sockets

Chris Torek chris at mimsy.UUCP
Thu Jul 28 12:03:12 AEST 1988


In article <354 at litp.UUCP> ratuld at litp.UUCP (Jean DERATULD p4055) writes:
>... The documentation on sockets says that there
>is some flag to have a blocking or non-blocking "accept" on sockets
>(the doc says about a SS_NBIO flag). The default is blocking sockets.
>Nothing is said about how to set it locally ....

The same way as any other non-blocking or no-delay I/O: either

	int on = 1, err;

	err = ioctl(fd, FIONBIO, &on);

or

	err = fcntl(fd, F_SETFL, FNDELAY);
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list