Documentation ¶
Overview ¶
Package unixsocket provides wrapper for Linux unix socket to send and recv oob messages including fd and user credential.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSocketPair ¶
NewSocketPair creates connected unix socketpair using SOCK_SEQPACKET
Types ¶
type Socket ¶
Socket wrappers a unix socket connection
func NewSocket ¶
NewSocket creates Socket conn struct using existing unix socket fd creates by socketpair or net.DialUnix and mark it as close_on_exec (avoid fd leak) it need SOCK_SEQPACKET socket for reliable transfer it will need SO_PASSCRED to pass unix credential, Notice: in the documentation, if cred is not specified, self information will be sent
func (*Socket) RecvMsg ¶
RecvMsg recvmsg from unix socket and parse possible unix right / credential
func (*Socket) SetPassCred ¶
SetPassCred set sockopt for pass cred for unix socket