ini
This commit is contained in:
parent
f7f0d6e5be
commit
83d51d3e83
30 changed files with 1186 additions and 208 deletions
36
Connection/public/Network.hpp
Normal file
36
Connection/public/Network.hpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#pragma once
|
||||
|
||||
#include "Common.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);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue