msg

package
v0.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestTypeInit    = "init"
	RequestTypeConnect = "connect"
)

Variables

This section is empty.

Functions

func ConnectToChild

func ConnectToChild(c *net.UnixConn, spec port.Spec) (int, error)

ConnectToChild connects to the child UNIX socket, and obtains TCP or UDP socket FD that corresponds to the port spec.

func ConnectToChildWithRetry

func ConnectToChildWithRetry(socketPath string, spec port.Spec, retries int) (int, error)

ConnectToChildWithRetry retries ConnectToChild every (i*5) milliseconds.

func ConnectToChildWithSocketPath

func ConnectToChildWithSocketPath(socketPath string, spec port.Spec) (int, error)

ConnectToChildWithSocketPath wraps ConnectToChild

func Initiate

func Initiate(c *net.UnixConn) error

Initiate sends "init" request to the child UNIX socket.

Types

type Reply

type Reply struct {
	Error string
}

Reply may contain FD as OOB

type Request

type Request struct {
	Type  string // "init" or "connect"
	Proto string // "tcp" or "udp"
	IP    string
	Port  int
}

Request and Response are encoded as JSON with uint32le length header.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL