Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!aplcen!haven!adm!xadmx!konczal@mail-gw.ncsl.nist.gov From: konczal@mail-gw.ncsl.nist.gov (Joseph C. Konczal) Newsgroups: comp.unix.questions Subject: Polling on a socket without select()... Message-ID: <21411@adm.BRL.MIL> Date: 9 Nov 89 16:50:28 GMT Sender: news@adm.BRL.MIL Lines: 28 | I am writing a program that needs to effect a poll on a udp/ip socket. I am | using recvfrom(2) to read data, but I would like it to return immediately if | there is no data ready... My SunOS4.x man page says that there is a method | to make the recvfrom() call return immediately using ioctl(2) to set the | socket to non-blocking... I have looked in and | but have not found any ioctl capable of doing this... | | I know of the method using select(2), but that seems like overkill if I only | have one socket, it is not really a selection process... Is there something | in a man page someplace that would explain this in some more detail or is it | a man page error? | | Thanx! | | Micky | | arpa: micky@cunixc.cc.columbia.edu | uucp: ...!rutgers!columbia!cunixc!micky | bitnet: malua@cuvmc It seems like a strange place for this information, but the socket(2) man page refers you to fcntl(2v) where under F_SETFL it tells you that using fcntl to set a certain flag will cause the desired ioctl to be performed... So look up FIONBIO in filio(4). Joe internet: konczal@mail-gw.ncsl.nist.gov