Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TCPClient ¶
type TCPClient interface {
Dial(network, address string) error
OnEvent(id int32, f func(conn net.Conn, data []byte))
OnOpen(func(conn net.Conn))
OnClose(func(conn net.Conn))
Emit(conn net.Conn, id int32, data []byte)
}
func NewTCPClient ¶
func NewTCPClient(config ...TCPClientConfig) TCPClient
type TCPClientConfig ¶
type TCPServer ¶
type TCPServer interface {
Listen(network string, address string) error
OnEvent(id int32, f func(conn net.Conn, data []byte))
OnOpen(func(conn net.Conn))
OnClose(func(conn net.Conn))
Emit(conn net.Conn, id int32, data []byte)
}
func NewTCPServer ¶
func NewTCPServer(config ...TCPServerConfig) TCPServer
type TCPServerConfig ¶
type TCPServerConfig struct {
ReadBufferSize int
}
type WSClient ¶
type WSClient interface {
Dial(address string, requestHeader http.Header) error
OnOpen(f func(conn *websocket.Conn))
OnClose(f func(conn *websocket.Conn))
OnEvent(id int32, f func(conn *websocket.Conn, data []byte))
Emit(conn *websocket.Conn, id int32, data []byte)
GetConn() *websocket.Conn
IsClosed() bool
}
func NewWSClient ¶
func NewWSClient(config ...WSClientConfig) WSClient
type WSClientConfig ¶ added in v1.0.5
type WSServer ¶
type WSServer interface {
Listen(mAddr, cAddr string) error
OnOpen(f func(conn *websocket.Conn, req *http.Request))
OnClose(f func(conn *websocket.Conn))
OnEvent(id int32, f func(conn *websocket.Conn, data []byte))
Emit(conn *websocket.Conn, id int32, data []byte)
}
func NewWSServer ¶
func NewWSServer(config ...WSServerConfig) WSServer
type WSServerConfig ¶
Click to show internal directories.
Click to hide internal directories.