20 lines
448 B
C
20 lines
448 B
C
|
#ifndef CHATSERVER_CONNLIST_H
|
||
|
#define CHATSERVER_CONNLIST_H
|
||
|
|
||
|
#include <stdint.h>
|
||
|
#include "oslib.h"
|
||
|
|
||
|
struct Connection {
|
||
|
uint8_t state;
|
||
|
struct LemonClientSocket socket;
|
||
|
pthread_t connThread;
|
||
|
int64_t userId; // -1 if not logged in
|
||
|
char username[64]; // to reduce db calls
|
||
|
};
|
||
|
|
||
|
struct Connection* allocateConnection();
|
||
|
void deallocateConnection(struct Connection* connection);
|
||
|
void initConnList(unsigned int maxConnCount);
|
||
|
|
||
|
#endif
|