Documentation ¶
Index ¶
- Constants
- func Copy(dst Sender, src Receiver) (int, error)
- func FdConn(fd int) (n *net.UnixConn, err error)
- func MsgDesc(payload []byte, attachment *os.File) string
- func Pair() (*Conn, *Conn, error)
- func SendRPipe(dst Sender, data []byte) (*os.File, error)
- func SendWPipe(dst Sender, data []byte) (*os.File, error)
- func SocketPair() (a *os.File, b *os.File, err error)
- func USocketPair() (*UnixConn, *UnixConn, error)
- type Conn
- type ReceiveCloser
- type ReceiveSender
- type Receiver
- type SendCloser
- type Sender
- type UnixConn
Constants ¶
const ( R int = 1 << (32 - 1 - iota) W )
Variables ¶
This section is empty.
Functions ¶
func FdConn ¶
FdConn wraps a file descriptor in a standard *net.UnixConn object, or returns an error if the file descriptor does not point to a unix socket. This creates a duplicate file descriptor. It's the caller's responsibility to close both.
func MsgDesc ¶
MsgDesc returns a human readable description of a beam message, usually for debugging purposes.
func SendRPipe ¶
SendRPipe create a pipe and sends its *read* end attached in a beam message to `dst`, with `data` as the message payload. It returns the *write* end of the pipe, or an error.
func SendWPipe ¶
SendWPipe create a pipe and sends its *read* end attached in a beam message to `dst`, with `data` as the message payload. It returns the *write* end of the pipe, or an error.
func SocketPair ¶
SocketPair is a convenience wrapper around the socketpair(2) syscall. It returns a unix socket of type SOCK_STREAM in the form of 2 file descriptors not bound to the underlying filesystem. Messages sent on one end are received on the other, and vice-versa. It is the caller's responsibility to close both ends.
func USocketPair ¶
Types ¶
type Conn ¶
type Conn struct {
*UnixConn
}
type ReceiveCloser ¶
type ReceiveSender ¶
func Devnull ¶
func Devnull() ReceiveSender
type SendCloser ¶
type UnixConn ¶
func (*UnixConn) Receive ¶
Receive waits for a new message on conn, and receives its payload and attachment, or an error if any.
If more than 1 file descriptor is sent in the message, they are all closed except for the first, which is the attachment. It is legal for a message to have no attachment or an empty payload.