Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(sockType types.SocketType, inst SocketInstance) (err error)
Types ¶
type SockMessage ¶ added in v1.2.0
type Socket ¶
type Socket interface { Listen() (err error) // bind and listen on address and port Accept() Socket // accept connection... Connect() (err error) // for tcp/web socket Send(data []byte, to ...string) (n int, err error) // send to... SendJson(v interface{}, to ...string) (n int, err error) // send json to... Recv(length int) (msg *SockMessage, err error) // receive from... if length > 0, will receive the bytes specified. Close() (err error) // close socket GetLocalAddr() string // get socket local address GetRemoteAddr() string // get socket remote address GetSocketType() types.SocketType // get socket type }
func NewSocketInstance ¶
func NewSocketInstance(sockType types.SocketType, ui *parser.UrlInfo, options ...SocketOption) (s Socket)
type SocketInstance ¶
type SocketInstance func(ui *parser.UrlInfo, options ...SocketOption) Socket
Click to show internal directories.
Click to hide internal directories.