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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,80ae596d36288e8a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Why no socket package in the standard ? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <872169864327910446.796089rmhost.bauhaus-maps.arcor.de@news.arcor.de> <9cb23235-8824-43f4-92aa-d2e8d10e7d8c@ct4g2000vbb.googlegroups.com> <1jue77mrlbkor$.1iuz25va18fvm$.dlg@40tude.net> <1sg3bjezic084.idxvmhddw1hd$.dlg@40tude.net> Date: Wed, 25 May 2011 14:26:18 +0200 Message-ID: NNTP-Posting-Date: 25 May 2011 14:26:18 CEST NNTP-Posting-Host: ede19f1b.newsspool4.arcor-online.net X-Trace: DXC=732W@7OYI^WaoembcbF;DQ4IUK On Wed, 25 May 2011 04:54:20 -0700 (PDT), Maciej Sobczak wrote: > On 25 Maj, 11:14, "Dmitry A. Kazakov" > wrote: > >>> Still, they (sockets) don't have to be part of the language to be >>> select-ready. It is enough to make them protected objects with >>> appropriate entries. >> >> 1. We need to be able to cancel connect/accept/send/receive from an AST or >> timed entry call. > > No problem, use non-blocking I/O as an underlying implementation. The problem is not the implementation, but the interface. If sockets to be a part of the language they should use language means for handling synchronization issues. >> 2. We should never do any I/O related stuff on the context of a protected >> action. > > No problem - the protected object need not represent the socket > directly, it might as well be a proxy only representing its current > state, in which case no I/O happens in the protected context. I meant handling the states, doing I/O from a protected action would be just illegal. But it is also inadmissible to handle read/write completion from there. Yes you could release some waiting tasks and pass the I/O buffer to one of them, this is how sockets are dealt with now. Such a clumsy design does not deserve standardization, IMO. I think that "task" is a more suitable abstraction for socket. task type Connect_Socket is entry Connect (...); entry Receive (...); entry Send (...) end Socket; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de