unique_ptr for sockets

This commit is contained in:
Benjamin Sergeant
2020-03-24 12:40:58 -07:00
parent 9f818c7acf
commit 179e17895d
25 changed files with 54 additions and 51 deletions

View File

@ -140,7 +140,7 @@ namespace ix
}
// Server
WebSocketInitResult WebSocketTransport::connectToSocket(std::shared_ptr<Socket> socket,
WebSocketInitResult WebSocketTransport::connectToSocket(std::unique_ptr<Socket> socket,
int timeoutSecs)
{
std::lock_guard<std::mutex> lock(_socketMutex);
@ -149,7 +149,7 @@ namespace ix
_useMask = false;
_blockingSend = true;
_socket = socket;
_socket = std::move(socket);
_perMessageDeflate = std::make_unique<WebSocketPerMessageDeflate>();
WebSocketHandshake webSocketHandshake(_requestInitCancellation,