# COMS3200 A1
Note: full function definitions are with the code itself.
## Assumptions Made
1. When a message is sent from a client, the client does not recieve it's own
message back
2. Username and any other arguments do not contain spaces
3. There are no restrictions on warnings (e.g. I have logged an error when
there is no config file specified)
## chatclient.py
This is the client that connects to the specified channel.
It does not contain a lot of logic besides sending an receiving messages.
Most of the functionality is done on the server.
The receiving messages are handled on a seperate thread.
This is to prevent thread locking.
The input is handled on the main thread.
### Function/Class Descriptions
- ChatClient: a class representing the chat client
- ChatClient._connect: sets up the connection to the channel and connects
- ChatClient._receive: retrieves messages from the socket and prints it to the
server's stdout
- ChatClient.start: starts the client, takes the user's input and sends it to
the server
- validate_arguments: makes sure the given arguments are correct
## chatserver.py
This is the server that hosts the channels for the clients to connect to.
Server-side commands (i.e. the commands executed in the cli) are processed
through the main thread.
Each channel gets it's own thread, to allow simultanously handling each
channel.
Each client also gets it's own thread.
In hindseight this is probably not a good idea, but as this is a small
project I didn't change this.
The channel and the (connecting) client are handled through classes for the
sake of modularity and not needing as many arguments.
The same is true for commands, though this was not really that necessary.
The username is set to "Anonymous" by default.
It is up to the client to authenticate with a username.
This is done by sending a packet containing the username after the user is
connected.
This also allows the user to change their username if a command is implemented.