From 4512bd49e774641b41526b5e46ec6057b5791cba Mon Sep 17 00:00:00 2001 From: Fred Nicolson Date: Fri, 24 Mar 2017 20:18:08 +0000 Subject: [PATCH] Made a few read/write tweaks --- src/TcpSocket.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/TcpSocket.cpp b/src/TcpSocket.cpp index 2294a98..3105c2e 100644 --- a/src/TcpSocket.cpp +++ b/src/TcpSocket.cpp @@ -31,12 +31,7 @@ namespace fr } else if(errno != EWOULDBLOCK && errno != EAGAIN) //Don't exit if the socket just couldn't block { - if(status == -1) - { - return Socket::Status::Error; - } - - is_connected = false; + close_socket(); return Socket::Status::Disconnected; } } @@ -69,12 +64,8 @@ namespace fr { return Socket::Status::WouldBlock; } - else if(status == -1) - { - return Socket::Status::Error; - } - is_connected = false; + close_socket(); return Socket::Status::Disconnected; }