make socket non-blocking
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user