msgba/include/msgba/client_connection_data.h

32 lines
790 B
C
Raw Normal View History

2023-03-10 23:37:11 +01:00
#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;
2023-03-13 00:06:19 +01:00
pthread_mutex_t *mutexSendPacket;
2023-03-10 23:37:11 +01:00
};
/**
* 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