Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ServerAddr string OnStateChange OnClientStateChange OnMsgRecv OnClientMsgRecv Conn net.Conn State ClientState // contains filtered or unexported fields }
func (*Client) SetOnMsgRecv ¶
func (c *Client) SetOnMsgRecv(handler OnClientMsgRecv) *Client
func (*Client) SetOnStateChange ¶
func (c *Client) SetOnStateChange(handler OnClientStateChange) *Client
type ClientState ¶
type ClientState int
const ( ClientConnected ClientState = iota ClientDisconnected )
type OnClientMsgRecv ¶
type OnClientStateChange ¶
type OnClientStateChange func(c *Client, newstate ClientState)
type Server ¶
type Server struct { ServerAddr string OnClientStateChange OnClientStateChange OnClientMsgRecv OnClientMsgRecv Listener net.Listener Conns []net.Conn }
func (*Server) SetOnMsgRecv ¶
func (s *Server) SetOnMsgRecv(handler OnClientMsgRecv) *Server
func (*Server) SetOnPeerStateChange ¶
func (s *Server) SetOnPeerStateChange(handler OnClientStateChange) *Server
Click to show internal directories.
Click to hide internal directories.