Fix some issues with transferring conn back to server
This commit is contained in:
@@ -323,7 +323,8 @@ private:
|
||||
* @param server Weak reference to the server for safe cleanup
|
||||
*/
|
||||
Connection(struct sockaddr_storage addr, int fd, int64_t id,
|
||||
ConnectionHandler *handler, std::weak_ptr<Server> server);
|
||||
size_t epoll_index, ConnectionHandler *handler,
|
||||
std::weak_ptr<Server> server);
|
||||
|
||||
/**
|
||||
* @brief Server-only factory method for creating connections.
|
||||
@@ -345,7 +346,8 @@ private:
|
||||
*/
|
||||
static std::unique_ptr<Connection>
|
||||
createForServer(struct sockaddr_storage addr, int fd, int64_t id,
|
||||
ConnectionHandler *handler, std::weak_ptr<Server> server);
|
||||
size_t epoll_index, ConnectionHandler *handler,
|
||||
std::weak_ptr<Server> server);
|
||||
|
||||
// Networking interface - only accessible by Server
|
||||
int readBytes(char *buf, size_t buffer_size);
|
||||
@@ -357,8 +359,10 @@ private:
|
||||
int getFd() const { return fd_; }
|
||||
bool hasMessages() const { return !messages_.empty(); }
|
||||
bool shouldClose() const { return closeConnection_; }
|
||||
size_t getEpollIndex() const { return epoll_index_; }
|
||||
const int fd_;
|
||||
const int64_t id_;
|
||||
const size_t epoll_index_; // Index of the epoll instance this connection uses
|
||||
struct sockaddr_storage addr_; // sockaddr_storage handles IPv4/IPv6
|
||||
ArenaAllocator arena_;
|
||||
ConnectionHandler *handler_;
|
||||
|
||||
Reference in New Issue
Block a user