From f7decf41d8d0062901cd39c42a3669a80537c7df Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Thu, 3 Aug 2017 20:03:59 +0500 Subject: 2017-08-03 --- src/Network.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/Network.cpp') diff --git a/src/Network.cpp b/src/Network.cpp index dcdda10..6cd9baa 100644 --- a/src/Network.cpp +++ b/src/Network.cpp @@ -3,9 +3,17 @@ Network::Network(std::string address, unsigned short port) { try { socket = new Socket(address, port); + } catch (std::exception &e) { + LOG(WARNING) << "CONNECT FAULT"; + delete socket; + throw; + } + + try { stream = new StreamSocket(socket); } catch (std::exception &e) { - LOG(FATAL)< Network::ReceivePacketByPacketId(int packetId, ConnectionState state, StreamInput &stream) { - std::shared_ptr packet(nullptr); + std::shared_ptr < Packet > packet(nullptr); switch (state) { case Handshaking: switch (packetId) { -- cgit v1.2.3