Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnStater ¶
ConnStater is the interface to get the ConnState of a connection. Must call Close to release it if you're going to close the connection.
func ListenConnState ¶
func ListenConnState(conn net.Conn, opts ...Option) (ConnStater, error)
ListenConnState returns a ConnStater for the given connection. Conn must be a syscall.Conn.
type OnRemoteClosed ¶ added in v0.1.9
type OnRemoteClosed func()
OnRemoteClosed is a callback function type that will be invoked when the remote side of the connection is closed.
type Option ¶ added in v0.1.9
type Option func(stater *connStater)
func WithOnRemoteClosed ¶ added in v0.1.9
func WithOnRemoteClosed(fn OnRemoteClosed) Option
WithOnRemoteClosed sets a callback function that will be called when the remote side closes the connection. The callback is invoked only once, when the state transitions from StateOK to StateRemoteClosed.
Click to show internal directories.
Click to hide internal directories.