CSIS 440 chat client/server project.

constants.h 1.1KB

    #ifndef __SIRC_CONSTANTS__ #define __SIRC_CONSTANTS__ /* Author: Matt Kava Asmt: CSIS 440, Spring 2010, Assignment 6 :: IRC-Like Client/Server Description: Constants usable for both the SircClient and SircServer implementations */ #include <string.h> #include <string> const unsigned short DEFAULT_WKS_PORT = 5500; // default port number that the server listens on const int MAX_USER_COUNT = 20; // maximum number of clients connected to server const int BUFFER_SIZE = 256; // size of server and client buffer const int MAX_NICK_LENGTH = 8; // maximum size of a nickname for a user const std::string DEFAULT_EOL = "\x0A"; // newline character const int DEFAULT_EOL_LENGTH = DEFAULT_EOL.size(); // length of the EOL string const int MAX_MESSAGE_LENGTH = BUFFER_SIZE - MAX_NICK_LENGTH - DEFAULT_EOL_LENGTH - 15 - 5 - 1; // maximum message length a server relays from a client const int LOWEST_VALID_ASCII = 32; // lowest ASCII value that is valid for a character (Message) const int HIGHEST_VALID_ASCII = 126; // highest ASCII value that is valid for a character (Message) #endif