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 { l3.TransportQueueConfig // RxBufferLength is the packet buffer length allocated for incoming packets. // The default is 16384. // Packet larger than this length cannot be received. RxBufferLength 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"` // RxQueueLength is the current number of packets in the RX queue. RxQueueLength int // RxQueueLength is the current number of packets in the TX queue. TxQueueLength int }
Counters contains socket transport counters.
type Transport ¶
type Transport interface { l3.Transport // 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.
A transport closes itself after its TX channel has been closed.
Click to show internal directories.
Click to hide internal directories.