Last Update (partial) have to link every file in the right place
This commit is contained in:
46
server/Network.hpp
Normal file
46
server/Network.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
/******************************************************************************
|
||||
* File: network.hpp
|
||||
*
|
||||
* Author: Tonitch
|
||||
* Created: 12/10/21
|
||||
* Description: Header for meuporg (name might change) for network part
|
||||
*****************************************************************************/
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <stdlib.h>
|
||||
#include <vector>
|
||||
#include <sys/select.h>
|
||||
#include "Config.hpp"
|
||||
|
||||
#ifndef NETWORK_H
|
||||
#define NETWORK_H
|
||||
class Network
|
||||
{
|
||||
private:
|
||||
int main_socket;
|
||||
std::vector<int> accepted_sock;
|
||||
int max_fd;
|
||||
|
||||
fd_set readfds;
|
||||
|
||||
sockaddr_in server, new_sockaddr;
|
||||
bool will_close = false;
|
||||
char msg[1025], motd[1025];
|
||||
|
||||
int rcv_bytes;
|
||||
unsigned int sin_size = sizeof(struct sockaddr*);
|
||||
|
||||
Config* conf;
|
||||
|
||||
public:
|
||||
Network();
|
||||
void run();
|
||||
};
|
||||
|
||||
|
||||
#endif /* NETWORK_H */
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user