3 ms·
"like Go channels over the network" um, sockets anyone?
by baq 12y ago
"like Go channels over the network"
um, sockets anyone?
- zimbatm 12y agoIt's possible to send a channel over a channel in go. This allows to for example to pass in the response channel of a message. It's possible to pass in file descriptors on unix sockets but it only works locally.
- shykes 12y agoNote that, when using the Unix socket transport, libchan actually utilizes the ability to pass file descriptors.
- shykes 12y agoYou can't send a tcp socket over a tcp socket :) (just one among many reasons why raw sockets are necessary but not sufficient).
- mbreese 12y agoAnd I suppose you can with a channel? Or are you just sending a proxy to the socket (which you could also do with a traditional socket and an appropriate protocol). I'm not trying to diminish the importance of an easy to use library that abstracts away the socket-level code with a good protocol. I'm just saying that sending a socket over a socket isn't a good way to pitch it.
- tlrobinson 12y agoHow does this work? If A has a channel to B, and sends that channel to C, do B and C now communicate directly, or is it proxied through A? EDIT: I see you mentioned the Unix socket transport passes around file descriptors. How about the inter-host transports? Obviously two browsers can't directly connect to each other (or could they with WebRTC...?) what about, say, TCP between hosts on the same local network?
- jvermillard 12y agoeach time you say raw socket I think about: http://man7.org/linux/man-pages/man7/raw.7.html http://man7.org/linux/man-pages/man7/raw.7.html and http://en.wikipedia.org/wiki/Raw_socket http://en.wikipedia.org/wiki/Raw_socket So you mean IP sockets without UDP or TCP?
- shykes 12y agoNo, sorry, I mean regular TCP sockets without extra framing, as opposed to the spdy or websocket transport.
- SixSigma 12y agoYou can on plan9, you can even send it over serial if you like
- nkozyra 12y agoThat alone doesn't ensure control of a channel, though. Passing data through sockets is easy, controlling that transmission in terms of state and potential race conditions, is much harder.
- deleted 12y ago[deleted]