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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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!postnews.google.com!z37g2000vbl.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Why no socket package in the standard ? Date: Wed, 25 May 2011 04:54:20 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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> NNTP-Posting-Host: 83.3.40.82 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1306324460 15211 127.0.0.1 (25 May 2011 11:54:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 25 May 2011 11:54:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z37g2000vbl.googlegroups.com; posting-host=83.3.40.82; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19469 Date: 2011-05-25T04:54:20-07:00 List-Id: 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. > 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. Both solutions above have been used in YAMI4: http://www.inspirel.com/yami4/ where in the high-level Ada interface outgoing messages are represented as protected objects exactly with the purpose of making them selectable. It is true, however, that YAMI4 operates at a much higher level of abstraction (messages vs. sockets) and this type of library design might not be adequate with something as low-level as sockets. On the other hand, asynchronous communication services (instead of naive use of basic socket API) could potentially solve this problem. Looks like an interesting project idea... -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com