Added linux includes for networking
TcpClient: added close_connection to shutdown the connection on both send and receive TcpServer: changed clients list initialization from constructors to using the reserve function
This commit is contained in:
@ -245,4 +245,12 @@ enum InternalTags
|
||||
|
||||
#define IS_HANDSHAKE(name) name.subject == 1 || (name.tag == DisconnectTag || name.tag == ConnectTag || name.tag == Accept || name.tag == Close || name.tag == Reject)
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
void closesocket(int socket) { close(socket); }
|
||||
#endif
|
||||
|
||||
#endif // DEFS_HPP
|
||||
@ -57,6 +57,7 @@ private:
|
||||
const NetworkBuffer &receive_data_array();
|
||||
static void receive_data(TcpClient *client);
|
||||
static bool send_network_message(const NetworkMessage &message, TcpClient *client);
|
||||
static void close_connection(TcpClient *client);
|
||||
|
||||
bool initialize(const std::string &ip, uint16 port = default_client_port);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user