-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibserver.h
52 lines (47 loc) · 1008 Bytes
/
libserver.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
** libserver.h for LibServer in /home/jobertomeu/Work/rush4/server/src
**
** Made by Joris Bertomeu
** Login <jobertomeu@epitech.net>
**
** Started on Sat May 10 17:04:26 2014 Joris Bertomeu
** Last update Sun May 11 19:26:46 2014 Joris Bertomeu
*/
#ifndef LIBSERVER_H_
#define LIBSERVER_H_
# include <stdio.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <fcntl.h>
# include <string.h>
# include <stdlib.h>
# include <sys/time.h>
# include <sys/types.h>
# include <unistd.h>
#include "../../include/world.h"
typedef struct s_clients t_clients;
struct s_clients
{
int active;
int id;
int idsock;
};
typedef struct s_libserver t_libserver;
struct s_libserver
{
int sockfd;
int newsockfd;
int portno;
int clilen;
int n;
char buffer[4096];
struct sockaddr_in serv_addr;
struct sockaddr_in cli_addr[6];
t_world *world;
int id_client;
t_clients clients[6];
int fds[6];
int fdtmp;
};
#endif /* LIBSERVER_H_ */