Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client interacts with the game server, including establishing connection to server, reading data from server and writing data to server etc.
TODO: Add heartbeating mechanism (eg., ping/pong) so that client can detect connection disruption especially for UDP protocol.
func NewTCPClient ¶
func NewUDPClient ¶
func (*Client) GenerateRandomNickname ¶
func (*Client) OnMessage ¶
func (c *Client) OnMessage(cb OnMessageCallback)
type OnMessageCallback ¶
Click to show internal directories.
Click to hide internal directories.