HY335a-Project
A_multithread_chat_Server_and_chat_client
 All Classes Files Functions Variables Typedefs Enumerations Macros
Public Member Functions
chatclient Class Reference

List of all members.

Public Member Functions

 chatclient (std::string server_ip, unsigned int port, bool automatic_discovery, std::string username)
msg_type_t get_message_type (char *buffer, size_t buf_len)

Constructor & Destructor Documentation

chatclient::chatclient ( std::string  server_ip,
unsigned int  port,
bool  automatic_discovery,
std::string  username 
)

The contructor of the chatclient.

Parameters:
server_ipThe ip of the server
portThe port that the server waits for incoming connections.
automatic_discoveryif true, the automatic server discovery is used to find out the server address and port. Also if this option is true server_ip and port parameters are ignored.
usernamethe username with which the client is going to perform a login at the sevrer.

Member Function Documentation

msg_type_t chatclient::get_message_type ( char *  buffer,
size_t  buf_len 
)

Function that finds the type of the received message.

Parameters:
[in]bufferThe buffer containing the data received from the server.
[in]buf_lenThe length of the buffer.
Returns:
the message type. If the type could NOT be found UKNOWN_MSG_TYPE should be returned.

The documentation for this class was generated from the following file: