Claude Chappe' Curse - A C Game
Logo Institut d'Informatique Claude Chappe Logo Université de Le Mans Logo Raeptor Production
 
Loading...
Searching...
No Matches
socket.h
Go to the documentation of this file.
1#ifdef _WIN32
2#include <winsock2.h>
3#include <ws2tcpip.h>
4#pragma comment(lib, "ws2_32.lib") // Link with Winsock library
5#define CLOSESOCKET closesocket // Windows uses closesocket() instead of close()
6
7#else
8#include <sys/select.h>
9#include <sys/socket.h>
10#include <netinet/in.h>
11#include <arpa/inet.h>
12#include <netdb.h>
13#include <unistd.h>
14#define CLOSESOCKET close
15#endif
16
32 fd_set readfds;
33 struct timeval timeout;
34};
35
72
84 char *msg;
85 int (*callback)(int msglen, char *msg, void * p, void ** data);
87 void ** data;
88};
89
90#include <io/socket/server.h>
91#include <io/socket/client.h>
Header file for socket client operations.
Network utility functions and structures for socket communication.
Header file for socket server functions.
Structure to handle messages.
Definition socket.h:83
int lifespan
Definition socket.h:86
void ** data
Definition socket.h:87
char * msg
Definition socket.h:84
int(* callback)(int msglen, char *msg, void *p, void **data)
Definition socket.h:85
Structure to represent a network peer.
Definition socket.h:64
char * incoming_buffer
Definition socket.h:67
int ping
Definition socket.h:68
int socket
Definition socket.h:65
struct socket_request_listener listener
Definition socket.h:66
struct message_handler ** handlers
Definition socket.h:69
int handler_count
Definition socket.h:70
Structure to hold socket request listener information.
Definition socket.h:31
fd_set readfds
Definition socket.h:32
struct timeval timeout
Definition socket.h:33