Working Server and Client
This commit is contained in:
26
network/networking.h
Normal file
26
network/networking.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef GAME_NETWORKING_H
|
||||
#define GAME_NETWORKING_H 1
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
typedef struct {
|
||||
const int max_clients;
|
||||
int server_fd;
|
||||
struct sockaddr_in address;
|
||||
int clients[2];
|
||||
int clientID;
|
||||
int client_count;
|
||||
} Server;
|
||||
|
||||
Server StartServer(int port);
|
||||
void RemoveClient(Server* s, int index);
|
||||
|
||||
typedef struct {
|
||||
int client_fd;
|
||||
struct sockaddr_in address;
|
||||
} Client;
|
||||
|
||||
|
||||
Client StartClient(char* host, int port);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user