Revision 22
moved around some more code
ConnectionPool.h | ||
---|---|---|
8 | 8 |
|
9 | 9 |
#include <sys/select.h> |
10 | 10 |
|
11 |
#include <colonet_wireless.h> |
|
12 |
|
|
11 | 13 |
#define MAX_TOKENS 15 |
12 | 14 |
#define MAX_TOKEN_SIZE 30 |
13 | 15 |
|
... | ... | |
17 | 19 |
#define ERROR_INVALID_CLIENT_DESCRIPTOR -1 |
18 | 20 |
#define ERROR_TOO_MANY_CLIENTS -2 |
19 | 21 |
#define ERROR_ALLOCATING_MEMORY -3 |
22 |
#define ERROR_NOT_ENOUGH_ROOM -4 |
|
23 |
#define ERROR_INVALID_COMMAND -5 |
|
24 |
#define ERROR_INVALID_CLIENT_ID -6 |
|
25 |
#define ERROR_INVALID_MESSAGE -7 |
|
26 |
#define ERROR_INVALID_MESSAGE_LENGTH -8 |
|
20 | 27 |
|
28 |
|
|
21 | 29 |
#define MAX_CONNECTIONS 250 |
22 | 30 |
#define READ_BUFFER_SIZE 1024 |
23 | 31 |
#define WRITE_BUFFER_SIZE 1024 |
... | ... | |
30 | 38 |
|
31 | 39 |
int add_client(int client_file_descriptor); |
32 | 40 |
int remove_client(int client_file_descriptor); |
33 |
int check_clients(); |
|
41 |
int check_clients(ColonetWireless * wireless);
|
|
34 | 42 |
int write_to_client(int pool_index, char * message, int length); |
35 | 43 |
void set_listen_socket_in_ready_set(int listen_socket); |
36 | 44 |
int perform_select(int listen_socket, struct timeval * select_timeout); |
... | ... | |
67 | 75 |
char * write_buffer[MAX_CONNECTIONS]; |
68 | 76 |
int write_buffer_size[MAX_CONNECTIONS]; |
69 | 77 |
|
70 |
int parse_command(char* command, int pool_index); |
|
78 |
int parse_command(char* command, int pool_index, ColonetWireless * wireless);
|
|
71 | 79 |
int tokenize_command(char* command, char tokens[MAX_TOKENS][MAX_TOKEN_SIZE]); |
72 | 80 |
int check_tokens(unsigned char* tokens, int numTokens); |
73 | 81 |
}; |
Also available in: Unified diff