Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorSendEmptyPacket error while sending empty packet ErrorSendEmptyPacket = errors.New("sending invalid packet (nil)") // ErrorQueueFull error while tx queue is full ErrorQueueFull = errors.New("sending queue is full") )
Functions ¶
func WaitSocketShutdown ¶
func WaitSocketShutdown()
WaitSocketShutdown wait for all client connection to close
Types ¶
type Config ¶
type Config struct { // HTTPort number for HTTP to listen on HTTPPort int // SocketReadDeadLine duration SocketReadDeadLine time.Duration // SocketReadBufferSize in bytes SocketReadBufferSize int // SocketWriteBufferSize in bytes SocketWriteBufferSize int // SocketSessionCacheSize size of outgoing packet queue SocketSessionCacheSize int // SocketTxQueueLength size of incoming packet queue SocketTxQueueLength int // SocketRPMLimit request per minute limit SocketRPMLimit int // SocketGracefulTimeout seconds to wait for a connection close SocketGracefulTimeout time.Duration // AuthTimeout timeout duration before authentication AuthTimeout time.Duration // WSAllowOrigin allow origin WSAllowOrigin bool // WSWriteDeadLine websocket write timeout WSWriteDeadLine time.Duration }
Config server options
type ConnWriteFunc ¶
ConnWriteFunc writes data to connection, for standard socket and web socket
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender send packets to the client
func NewSender ¶
func NewSender(ctrl chan struct{}, queueSize, sendCacheSize int, writer ConnWriteFunc) *Sender
NewSender create and returns a sender instance
func (*Sender) EnqueueOutgoing ¶
EnqueueOutgoing push data to the sender's pending channel
Click to show internal directories.
Click to hide internal directories.