msgba/include/msgba/client_connection_data.h

32 lines
790 B
C

#ifndef MS_CLIENT_CONNECTION_DATA
#define MS_CLIENT_CONNECTION_DATA
#include <stddef.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
struct msCoreController;
/**
* Struct representing everything needed while a connection is established.
*/
struct msClientConnectionData {
size_t numberOfThread;
int clientFd;
struct msCoreController *coreController;
pthread_mutex_t *mutexSendPacket;
};
/**
* Creates a new msClientConnectionData.
*
* @param numberOfThread The unique identifier for this connection.
* @param clientFd The client fd from which receive/send messages.
*/
struct msClientConnectionData *
msClientConnectionDataNew(size_t numberOfThread, int clientFd);
void
msClientConnectionDataDestroy(struct msClientConnectionData **data);
#endif