![]() |
C-chat
|
A type representing a connected client. More...
#include <server.h>
Public Attributes | |
Socket | socket |
char | username [USERNAME_MAX_LENGTH+1] |
short | joined |
Thread | thread |
struct { | |
unsigned int fileId | |
long long fileSize | |
long long received | |
char * fileContent | |
} | uploadData [MAX_CONCURRENT_FILE_TRANSFER] |
struct { | |
Thread downloadThread | |
unsigned int downloadedFileId | |
} | downloadData [MAX_CONCURRENT_FILE_TRANSFER] |
struct Room * | room |
A type representing a connected client.
short Client::joined |
A short indicating whether or not, the client joined discussion. Equal to 0 if client isn't in the discussion, else 1.
struct Room* Client::room |
A pointer to the room the client joined. Can be NULL.
It can be written to NULL by room-owner thread at any time if the room owner disband deletes the room. It can be written to NULL by self thread at any time if the client asks to leave the room. It can be written to non-NULL value ONLY by self thread when the client asks to create a join a room. It can be read by self thread at any time to relay packets to clients in the room.
We MUST acquire clientsLock to access this field.
Socket Client::socket |
The socket from server to the client
char Client::username[USERNAME_MAX_LENGTH+1] |
A buffer meant to contain client username