Documentation ¶
Overview ¶
Package sockettransport implements a transport based on stream or datagram sockets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // MTU is maximum outgoing packet size. // The default is 16384. MTU int // RedialBackoffInitial is the initial backoff period during redialing. // The default is 100ms. RedialBackoffInitial time.Duration // RedialBackoffMaximum is the maximum backoff period during redialing. // The default is 60s. // The minimum is RedialBackoffInitial. RedialBackoffMaximum time.Duration }
Config contains socket transport configuration.
type Counters ¶
type Counters struct { // NRedials indicates how many times the socket has been redialed. NRedials int `json:"nRedials"` }
Counters contains socket transport counters.
type Transport ¶
type Transport interface { l3.Transport // Context returns a Context that is canceled when the transport is closed. Context() context.Context // Conn returns the underlying socket. // Caller may gather information from this socket, but should not close or send/receive on it. // The socket may be replaced during redialing. Conn() net.Conn // Counters returns current counters. Counters() Counters }
Transport is an l3.Transport that communicates over a socket.
A transport has automatic error handling: if a socket error occurs, the transport automatically redials the socket. In case the socket cannot be redialed, the transport remains in "down" status.
Click to show internal directories.
Click to hide internal directories.