🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #331

Re: non-blocking accept()

#331
From: Kartik Subbarao
Date: Thu, 09 Apr 1992 17:30
13 lines
1061 bytes
In article <1992Apr9.164413.17641@helios.physics.utoronto.ca> amid@bullet.ecf (AMID  Rudy) writes:
>'lo,
>
>  Can someone suggest to me exactly how to mark accept() non-blocking?  If
>I RTFM correctly, I have to set the file descriptor somehow.  I'm a novice
>Unix and C programmer so any help in this section is greatly appreciated.
>This is, btw, a socket programming project that I have to do in University.

Use fcntl on the socket. 

	fcntl(s, F_SETFL, FNDELAY);

	-Kartik
Technical Details
Message-ID: <1992Apr9.173021.12838@Princeton.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!princeton!phoenix.Princeton.EDU!subbarao
References: <1992Apr9.164413.17641@helios.physics.utoronto.ca>

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!princeton!phoenix.Princeton.EDU!subbarao
From: subbarao@phoenix.Princeton.EDU (Kartik Subbarao)
Subject: Re: non-blocking accept()
Message-ID: <1992Apr9.173021.12838@Princeton.EDU>
Sender: news@Princeton.EDU (USENET News System)
Nntp-Posting-Host: phoenix.princeton.edu
Organization: putchar('I'); for (i = 0; i < 3; i++) putchar('E');
References: <1992Apr9.164413.17641@helios.physics.utoronto.ca>
Date: Thu, 9 Apr 1992 17:30:21 GMT
Lines: 13