Article View: news.software.nntp
Article #56246Re: How recv() determines the receiving is finished?
From: Joshua
Date: Mon, 28 Jan 2002 02:43
Date: Mon, 28 Jan 2002 02:43
19 lines
2005 bytes
2005 bytes
Yes,I think I don't need non-blocking I/O. I think maybe I don't need 'select' function. Andrew's idea sounds good. I am trying that. "Russ Allbery" <rra@stanford.edu> wrote in message news:yl4rl7zeel.fsf@windlord.stanford.edu... > Russ Allbery <rra@stanford.edu> writes: > > > Yes, recv() normally blocks until it gets data. If you don't want that > > behavior, you need to use non-blocking I/O and a select() loop to wait > > for new data. > > You don't actually *need* non-blocking I/O, I should add. It's just > easier to think about that way in my opinion. The basic idea is that you > use select to check your file descriptors and wait for something to > happen, and you don't try to read until select says that there's data > waiting.
Technical Details
Message-ID:
<a32ifu$rpp$3@mail.cn99.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!news-out.spamkiller.net!propagator-maxim!feed.newsfeeds.com!news-in.spamkiller.net!news.cn99.com!not-for-mailReferences:
<a30rss$f0j$1@mail.cn99.com> <yly9iju1i5.fsf@windlord.stanford.edu> <a31khk$895$1@mail.cn99.com> <ylsn8ro9o0.fsf@windlord.stanford.edu> <yl4rl7zeel.fsf@windlord.stanford.edu>Show Full Headers
Complete Article Headers
Message-ID: <a32ifu$rpp$3@mail.cn99.com> Subject: Re: How recv() determines the receiving is finished? Date: Mon, 28 Jan 2002 10:43:55 +0800 From: "Joshua" <JoshuaIIII@hotmail.com> References: <a30rss$f0j$1@mail.cn99.com> <yly9iju1i5.fsf@windlord.stanford.edu> <a31khk$895$1@mail.cn99.com> <ylsn8ro9o0.fsf@windlord.stanford.edu> <yl4rl7zeel.fsf@windlord.stanford.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!news-out.spamkiller.net!propagator-maxim!feed.newsfeeds.com!news-in.spamkiller.net!news.cn99.com!not-for-mail Newsgroups: news.software.nntp Organization: Bentium Ltd. (CN99) Lines: 18 NNTP-Posting-Host: 61.156.68.41 X-Trace: mail.cn99.com 1012190527 28473 61.156.68.41 (28 Jan 2002 04:02:07 GMT) X-Complaints-To: usenet@news.cn99.com NNTP-Posting-Date: Mon, 28 Jan 2002 04:02:07 +0000 (UTC) X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200