event/ServerSocket: pass UniqueSocketDescriptor by value
Passing it by value is actually smaller (32 bit) than the rvalue reference (64 bit pointer), and it ensures that the object is consumed after the call returns, no matter how the methods are implemented.
This commit is contained in:
@@ -97,7 +97,7 @@ public:
|
||||
std::list<ClientMessage> messages;
|
||||
|
||||
Client(EventLoop &loop, Partition &partition,
|
||||
UniqueSocketDescriptor &&fd, int uid, int num);
|
||||
UniqueSocketDescriptor fd, int uid, int num);
|
||||
|
||||
~Client() {
|
||||
if (FullyBufferedSocket::IsDefined())
|
||||
@@ -239,7 +239,7 @@ client_manager_init();
|
||||
|
||||
void
|
||||
client_new(EventLoop &loop, Partition &partition,
|
||||
UniqueSocketDescriptor &&fd, SocketAddress address, int uid);
|
||||
UniqueSocketDescriptor fd, SocketAddress address, int uid);
|
||||
|
||||
/**
|
||||
* Write a printf-like formatted string to the client.
|
||||
|
Reference in New Issue
Block a user