Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Threshold : Limit of simultanous message between client from channel BUFFER_CLIENT_NB_MESSAGE_THRESHOLD = 200 // Threshold : Limit the buffer size for sockets BUFFER_SIZE = 1024 )
Variables ¶
This section is empty.
Functions ¶
func ClientHandler ¶
*
- Manage I/O client from server socket *
- @param connection - Socket between client and server
- @param messageChannel - The shared bus message between all clients
- @param clients - The list of all clients connected
func ClientReceiver ¶
func ClientReceiver(client *Client)
*
- Manage client input from server-side socket *
- @param client - Client object
func ClientSender ¶
func ClientSender(client *Client)
*
- Manage output from server-side socket *
- @param client - Client object
Types ¶
type Client ¶
type Client struct { Incoming chan string // Message Channel : Input Outgoing chan string // Message Channel : Output Connection net.Conn // Socket between client and server Quit chan bool // Message Channel which contains the state of connection Clients *list.List // List of clients connected from server }
* Client structure
func (Client) RemoveMe ¶
func (c Client) RemoveMe()
*
- Remove client from the list of connected users
func (Client) Send ¶
*
- Send data from client socket
- @param buffer - []byte
- @return int - nb bytes sent
Click to show internal directories.
Click to hide internal directories.