mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
make socket non-blocking
This commit is contained in:
parent
e8b674ca65
commit
18bdce52df
3 changed files with 37 additions and 8 deletions
|
|
@ -40,7 +40,8 @@ namespace network {
|
|||
|
||||
class Network {
|
||||
std::unique_ptr<Requests> requests;
|
||||
std::vector<std::shared_ptr<Socket>> connections;
|
||||
std::unordered_map<u64id_t, std::shared_ptr<Socket>> connections;
|
||||
u64id_t nextConnection = 1;
|
||||
public:
|
||||
Network(std::unique_ptr<Requests> requests);
|
||||
~Network();
|
||||
|
|
@ -52,7 +53,9 @@ namespace network {
|
|||
long maxSize=0
|
||||
);
|
||||
|
||||
std::shared_ptr<Socket> connect(const std::string& address, int port);
|
||||
Socket* getConnection(u64id_t id) const;
|
||||
|
||||
u64id_t connect(const std::string& address, int port);
|
||||
|
||||
size_t getTotalUpload() const;
|
||||
size_t getTotalDownload() const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue