-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.h
More file actions
29 lines (26 loc) · 775 Bytes
/
Copy pathserver.h
File metadata and controls
29 lines (26 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef SERVER_H
#define SERVER_H
#include"networkStructures.h"
#include<pthread.h>
class Server{
pthread_t recvThread;
pthread_t hostThread;
struct ::socketsOpened *sockets;
int hosting(void);
void *get_in_addr(struct sockaddr *);
char *portno;
void*(*function)(void*);
void*(*onConnection)(void *);
void *additionalData;
void *conn_args;
int client_sock,sock;
public :
Server();
int start(char *,void*(connected)(void *),void *,void *(receivedDataProcessor)(void *),void *);
int start_unthreaded(char *,void*(connected)(void *),void *,void *(receivedDataProcessor)(void *),void *);
int sendData(void *,int );
void shut(void);
pthread_t *getThreadID();
bool accept_condition;
};
#endif // SERVER_H