Documentation
¶
Index ¶
Constants ¶
View Source
const ( TCP = "tcp" WEBSOCKET = "ws" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance interface {
Schema() Schema
// Listen runs the thread that will receive the connection
Listen(onAccept func(conn net.Conn)) error
// Shutdown shuts down the acceptor
Shutdown()
}
Instance represents a server for accepting connections
func NewAcceptor ¶
type Options ¶
type Options struct {
Core int
ReadBufferSize int
WriteBufferSize int
Keepalive bool
WriteDeadline time.Duration
ReadDeadline time.Duration
LengthOffset int
}
func DefaultOptions ¶
func DefaultOptions() Options
type Schema ¶
Schema represents a protocol specification
func NewTCPSchema ¶
func NewWebSocketSchema ¶
type TCPAcceptor ¶
type TCPAcceptor struct {
*Acceptor
// contains filtered or unexported fields
}
TCPAcceptor represents tcp acceptor
type WebsocketAcceptor ¶
type WebsocketAcceptor struct {
*Acceptor
// contains filtered or unexported fields
}
WebsocketAcceptor represents websocket acceptor
Click to show internal directories.
Click to hide internal directories.