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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ff1f0403676a2300 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.75.8 with SMTP id y8mr1575984wiv.4.1344889743511; Mon, 13 Aug 2012 13:29:03 -0700 (PDT) MIME-Version: 1.0 Path: q11ni114511992wiw.1!nntp.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Ada Networking (General/Design) Date: Mon, 13 Aug 2012 20:28:58 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <19sij6rw9nhaa.164mz6sr816wk.dlg@40tude.net> NNTP-Posting-Host: Lf0Nl3CcQzx+ocHx9cmuGg.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Tom's custom newsreader Date: 2012-08-13T20:28:58+00:00 List-Id: > In an Ada friendly way they should be entry calls, with the semantics of > canceling the request when a timed entry call gets timed out. That is when > the socket is blocking: > > select > Socket.Receive (Packet); > or delay 10.0; -- Failed to read > or terminate; -- Yes I know, it is illegal to have terminate + delay > end select; > > Or maybe other way round, they should be "entry points" to which socket I/O > could call to. > Get(Socket, Timeout => 10.0, Item => Buffer, Last => Last); where Last = Buffer'first-1 on timeout, seems simpler to me. > For non-blocking I/O there should be a way to have a pseudo-task ran by the > events on the socket, rather than scheduled. That's what overidable procedures When_Connect, When_Readable, When_Disconnect, etc are for. They are called when the event occurs.