From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,56e5e06428166864 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news2.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.68.MISMATCH!feeder.news-service.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: problems with interfacing c Date: Fri, 21 Jan 2011 01:46:24 +0100 Organization: Ada @ Home Message-ID: References: <8b6a5b24-5ab0-4d38-9be8-86911aba7fcf@k22g2000yqh.googlegroups.com> <13d5wy5ni51xh$.xnhoi3uhm9ql.dlg@40tude.net> <10wpqz6h1md5o.1gxwql45phwmt.dlg@40tude.net> NNTP-Posting-Host: oRnvGWegiqWfMVl+MhjypA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/11.00 (Win32) Xref: g2news1.google.com comp.lang.ada:16594 Date: 2011-01-21T01:46:24+01:00 List-Id: Le Fri, 21 Jan 2011 00:03:22 +0100, Dmitry A. Kazakov = a =C3=A9crit: >> Some body do, for some kind of raw IO. Just that this may be more = >> oftenly >> something like >> Character'Read (Standard_Input), C); > > That the point, when reading characters that suggests some character = > stream > oriented protocol. Dealing with such protocols one would never read 10= 0K = > in > one chunk. Because if the client does something wrong that would deadl= ock > forever. This could block for a single character as much. The only way to not blo= ck = would be either to test before read; this implies to read an item at a = time, before the condition must be checked before each item is read (so = a = loop), or else indeed to use asynchronous IO as you suggested later. Wit= h = the latter choice, buffered IO is OK. You may use Overlapped IO in = Windows, alternatively, there are nonblocking socket IO available (retur= ns = WSAEWOULDBLOCK error if a read access would block). Don't know about POS= IX = (oops). (I feel to remember there was a talk here about buffered IO, I cannot = remember the thread's title) -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens. =E2=80=9CI am fluent in ASCII=E2=80=9D [Warren 2010]