Article View: borland.public.cppbuilder.nativeapi
Article #14049Re: Converting Socket to NonBlocking
From: Remy Lebeau (TeamB)
Date: Sun, 07 Sep 2003 09:31
Date: Sun, 07 Sep 2003 09:31
29 lines
2159 bytes
2159 bytes
"Dumboo" <dumboo@nowhere.com> wrote in message news:3f5aef07$1@newsgroups.borland.com... > i have created a small server(using RAW BSD Socket API), > which is by default in Blocking mode, i want to convert it to > a non-blocking mode using only BSD Socket API's so that > the server is portable across platoforms, is it possible ? As far as I know, non-blocking sockets are a Microsoft Windows construct, they are based on HWND windows and posting window message notifications. Other platforms use just blocking sockets. With that said, under MSWindows/WinSock at least, non-blocking sockets are enabled using ioctlsocket(FIONBIO) and then utilizing the various WSA...() functions introduced in WinSock for asynchronous socket operations, such as WSAAsyncGetHostByName(), WSAAsyncSelect(), etc. in addition to the standard socket functions such as socket(), connect(), listen(), etc. I do not know whether FIONBIO or the WSA...() functions are available under other platforms besides MSWindows. Gambit --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03
Technical Details
Message-ID:
<3f5afae1$3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f5aef07$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,e15b5507c670aacd X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-07 02:34:50 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f5aef07$1@newsgroups.borland.com> Subject: Re: Converting Socket to NonBlocking Date: Sun, 7 Sep 2003 02:31:44 -0700 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3f5afae1$3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1062927073 207.175.226.26 (7 Sep 2003 02:31:13 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail