Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acceptor ¶
type Acceptor struct {
// contains filtered or unexported fields
}
func NewAcceptor ¶
type Instance ¶
type Instance interface {
// Run runs the thread that will receive the connection
Run(bind string) error
// Shutdown shuts down the acceptor
Shutdown()
}
Instance represents a server for accepting connections
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 TCPAcceptor ¶
type TCPAcceptor struct {
// contains filtered or unexported fields
}
TCPAcceptor represents tcp acceptor
func NewTCPAcceptor ¶
func NewTCPAcceptor(options Options, handler func(conn net.Conn)) *TCPAcceptor
NewTCPAcceptor returns a new instance of the TCPAcceptor
func (*TCPAcceptor) Run ¶
func (server *TCPAcceptor) Run(bind string) (err error)
Run runs the acceptor
type WebsocketAcceptor ¶
type WebsocketAcceptor struct {
// contains filtered or unexported fields
}
WebsocketAcceptor represents websocket acceptor
func NewWSAcceptor ¶
func NewWSAcceptor(options Options, handler func(conn net.Conn)) *WebsocketAcceptor
NewWSAcceptor return a new instance of the WebsocketAcceptor
func (*WebsocketAcceptor) Run ¶
func (acceptor *WebsocketAcceptor) Run(bind string) (err error)
Run runs websocket acceptor
func (*WebsocketAcceptor) Shutdown ¶
func (acceptor *WebsocketAcceptor) Shutdown()
Shutdown shuts down acceptor
Click to show internal directories.
Click to hide internal directories.