9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Skip Tavakkolian <skip.tavakkolian@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] two questions about go in Plan 9
Date: Mon, 18 Feb 2013 13:39:11 -0800	[thread overview]
Message-ID: <CAJSxfm+Rmo0N3aQm210axw3GwFWNjrScqWKeZYWkft247vZPhA@mail.gmail.com> (raw)
In-Reply-To: <EC5F3595-B3DB-4AA5-9107-FB134CB27E91@lsub.org>

i think linux and windows both distinguish between allowing io to
complete or not via shutdown() and close() respectively (close causes
a RST instead of FIN).

if my understanding is correct, then:  netFD.CloseRead and CloseWrite
for Plan 9 will work by just closing the ctl and data fd's;
netFD.Close should write "hangup" to ctl and SetLinger could easily be
implemented (it returns EPLAN9 on the Go version I'm using -- tip from
a few days ago).

-Skip

On Mon, Feb 18, 2013 at 11:04 AM, Nemo <nemo@lsub.org> wrote:
> yes. that was the problem.
> perhaps exporting hangup would be
> fine.
>
> or perhaps a close in a tcp stream
> should also interrupt the reader in
> plan9, if any.
>
> thanks
>
> On Feb 18, 2013, at 7:58 PM, akumar@mail.nanosouffle.net wrote:
>
>> In order to deal with Conn types, you're supposed to just
>> use the interface's functions. Unfortunately, Conn's
>> Close() simply closes the associated fd. I think in general,
>> this is fine. For the Listener, a Close() will do the hangup.
>>
>> I'm updating the net package implementation for Plan 9,
>> so new ideas are welcome in this phase. We can try to
>> export a Hangup() function for Plan 9 for the Conn type
>> (or for individual implementations of the type).
>>
>> On 18 February 2013 10:12, Francisco J Ballesteros <nemo@lsub.org> wrote:
>>> I know, but, what's the std way to do that in go in plan 9?
>>>
>>> On Feb 18, 2013, at 7:07 PM, cinap_lenrek@gmx.de wrote:
>>>
>>>> network connections on plan9 can be hanged up by writing "hangup" into
>>>> the corresponding ctl file.
>>>>
>>>> --
>>>> cinap
>>>>
>>>> [/mail/box/nemo/msgs/201302/897]
>>
>> [/mail/box/nemo/msgs/201302/902]
>



  reply	other threads:[~2013-02-18 21:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 19:04 Nemo
2013-02-18 21:39 ` Skip Tavakkolian [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-02-18 18:12 Francisco J Ballesteros
2013-02-18 18:22 ` Matthew Veety
2013-02-18 18:56 ` Akshat Kumar
2013-02-18 17:43 Nemo
2013-02-18 18:05 ` cinap_lenrek
2013-02-18 15:21 Francisco J Ballesteros
2013-02-18 16:51 ` lucio
2013-02-18 15:04 Francisco J Ballesteros
2013-02-18 15:16 ` Matthew Veety

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJSxfm+Rmo0N3aQm210axw3GwFWNjrScqWKeZYWkft247vZPhA@mail.gmail.com \
    --to=skip.tavakkolian@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).