Modules/Connection/public/Network.hpp
2024-03-16 12:51:09 +03:00

36 lines
No EOL
589 B
C++

#pragma once
#include "Module.hpp"
namespace tp {
class ServerContext;
class ClientContext;
class Server {
ServerContext* mContext;
public:
typedef void* Socket;
public:
Server();
~Server();
void start(ualni port);
Socket accept();
bool read(Socket client, int1* message, halni size);
bool write(Socket client, const int1* message, halni size);
};
class Client {
ClientContext* mContext;
public:
Client();
~Client();
bool connect(const int1* IP, ualni PORT);
bool read(int1* buff, halni size);
bool write(const int1* message, halni size);
};
}