From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Sat, 18 Jul 2009 06:25:19 EDT." <158688033fe375ed6e935e472986d876@quanstro.net> References: <158688033fe375ed6e935e472986d876@quanstro.net> From: Bakul Shah Date: Sat, 18 Jul 2009 11:52:23 -0700 Message-Id: <20090718185223.F2A275B18@mail.bitblocks.com> Subject: Re: [9fans] channels across machines Topicbox-Message-UUID: 2601295e-ead5-11e9-9d60-3106f5b1d025 On Sat, 18 Jul 2009 06:25:19 EDT erik quanstrom wrote: > On Sat Jul 18 03:46:01 EDT 2009, bakul+plan9@bitblocks.com wrote: > > Has anyone extended the idea of channels where the > > sender/receiver are on different machines (or at least in > > different processes)? A netcat equivalent for channels! > > i think the general idea is that if you want to do this between > arbitrary machines, you provide a 9p interface. you can think > of 9p as a channel with a predefined set of messages. acme > does this. kernel devices do this. > > however inferno provides file2chan > http://www.vitanuova.com/inferno/man/2/sys-file2chan.html. > of course, somebody has to provide the 9p interface, even > if that's just posting a fd to /srv. > > if you wanted to do something like file2chan in plan 9 and c, you're > going to have to marshal your data. this means that chanconnect > as specified is impossible. (acme avoids this by using text only. > the kernel devices keep this under control by using a defined > byte order and very few binary interfaces.) i don't know how you would > solve the naming problems e.g. acme would have using dial-string > addressing (i assume that's what you ment; host-port addressing is > ip specific.). what would be the port-numbering huristic for allowing > multiple acmes on the same cpu server? > > after whittling away problem cases, i think one is left with pipes, > and it seems pretty clear how to connect things so that > chan <-> pipe <-> chan. one could generalize to multiple > machines by using tools like cpu(1). First of all, thanks for all the responses! I should've mentioned this won't run on top of plan9 (or Unix). What I really want is alt! I brought up RPC but really, this is just Limbo's "chan of " idea. In the concurrent application where I want to use this, it would factor out a bunch of stuff and simplify communication. The chanconnect(":") syntax was to get the idea across. A real building block might look something like this: int fd = Chan c = fd2chan(fd, ); Ideally I'd generate relevant struct definitions and marshalling functions from the same spec. -- bakul