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: a07f3367d7,ff1f0403676a2300 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.216.237.155 with SMTP id y27mr412801weq.11.1345237548406; Fri, 17 Aug 2012 14:05:48 -0700 (PDT) MIME-Version: 1.0 Path: n2ni181703136win.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!feed.xsnews.nl!border-1.ams.xsnews.nl!plix.pl!newsfeed2.plix.pl!217.153.128.51.MISMATCH!nf1.ipartners.pl!ipartners.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Ada Networking (General/Design) Date: Tue, 14 Aug 2012 17:57:24 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <5i0visgzog1.6g1g6fnuefla$.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-14T17:57:24+00:00 List-Id: >>> 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. > >No, that is upside-down. The point is to write I/O code as if it were >synchronous and half-duplex: > > send > receive > process > send > ... > >Compare it with Ada task. You write a task as if it didn't share the >processor, you don't hook at timer interrupts. Sorry, I misunderstood "pseudo-task ran by the events on the socket" to mean roughly "interrupt-driven". Claw.Sockets has "Async_Socket_Type and procedures When_xxx for that. I agree that it's usually easier to "write I/O code as if it were synchronous and half-duplex:" with the simple Socket_Type and Put, Get, Process, Put...