Browse Source

Fixed EWOULDBLOCK errno on Windows

Paul-Louis Ageneau 5 years ago
parent
commit
ad676815bd
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/tcptransport.cpp

+ 2 - 1
src/tcptransport.cpp

@@ -21,6 +21,7 @@
 #if RTC_ENABLE_WEBSOCKET
 
 #include <exception>
+
 #ifndef _WIN32
 #include <fcntl.h>
 #include <unistd.h>
@@ -278,7 +279,7 @@ bool TcpTransport::trySendMessage(message_ptr &message) {
 #endif
 		int len = ::send(mSock, data, int(size), flags);
 		if (len < 0) {
-			if (errno == EAGAIN || errno == EWOULDBLOCK) {
+			if (sockerrno == EAGAIN || sockerrno == EWOULDBLOCK) {
 				message = make_message(message->end() - size, message->end());
 				return false;
 			} else {