Versions in this module Expand all Collapse all v2 v2.0.0 Dec 4, 2023 Changes in this version + type Client interface + Dial func() (Conn, error) + OnConnect func(handler ConnectHandler) + OnDisconnect func(handler DisconnectHandler) + OnReceive func(handler ReceiveHandler) + type CloseHandler func() + type Conn interface + Bind func(uid int64) + Close func(isForce ...bool) error + ID func() int64 + LocalAddr func() (net.Addr, error) + LocalIP func() (string, error) + Push func(msg []byte) error + RemoteAddr func() (net.Addr, error) + RemoteIP func() (string, error) + Send func(msg []byte) error + State func() ConnState + UID func() int64 + Unbind func() + type ConnState int32 + const ConnClosed + const ConnHanged + const ConnOpened + type ConnectHandler func(conn Conn) + type DisconnectHandler func(conn Conn) + type ReceiveHandler func(conn Conn, msg []byte) + type Server interface + Addr func() string + OnConnect func(handler ConnectHandler) + OnDisconnect func(handler DisconnectHandler) + OnReceive func(handler ReceiveHandler) + OnStart func(handler StartHandler) + OnStop func(handler CloseHandler) + Protocol func() string + Start func() error + Stop func() error + type StartHandler func()