address.setFromLocalAddress(fd);
setupSocket(fd);
- sockets_.push_back(
- ServerEventHandler(eventBase_, fd, this, address.getFamily()));
+ sockets_.emplace_back(eventBase_, fd, this, address.getFamily());
sockets_.back().changeHandlerFD(fd);
}
}
// If we just created this socket, update the EventHandler and set socket_
if (!isExistingSocket) {
- sockets_.push_back(
- ServerEventHandler(eventBase_, fd, this, address.getFamily()));
+ sockets_.emplace_back(eventBase_, fd, this, address.getFamily());
}
}
SocketAddress address;
address.setFromLocalAddress(s);
- sockets_.push_back(
- ServerEventHandler(eventBase_, s, this, address.getFamily()));
+ sockets_.emplace_back(eventBase_, s, this, address.getFamily());
// Bind to the socket
if (::bind(s, res->ai_addr, res->ai_addrlen) != 0) {
eventBase = eventBase_; // Run in AsyncServerSocket's eventbase
}
- callbacks_.push_back(CallbackInfo(callback, eventBase));
+ callbacks_.emplace_back(callback, eventBase);
// Start the remote acceptor.
//