minor derivative to reduce compiler warnings and tag read-only parameters as const.
Fork of Socket by
Diff: TCPSocketConnection.cpp
- Revision:
- 21:04922f6a3602
- Parent:
- 20:5abbc0e39fb1
diff -r 5abbc0e39fb1 -r 04922f6a3602 TCPSocketConnection.cpp --- a/TCPSocketConnection.cpp Tue Jul 07 14:03:07 2015 +0000 +++ b/TCPSocketConnection.cpp Sun Apr 09 20:57:44 2017 +0000 @@ -30,11 +30,11 @@ return -1; if (set_address(host, port) != 0) - return -1; + return -2; if (lwip_connect(_sock_fd, (const struct sockaddr *) &_remoteHost, sizeof(_remoteHost)) < 0) { close(); - return -1; + return -3; } _is_connected = true; @@ -52,7 +52,7 @@ if (!_blocking) { TimeInterval timeout(_timeout); if (wait_writable(timeout) != 0) - return -1; + return -2; } int n = lwip_send(_sock_fd, data, length, 0); @@ -83,7 +83,7 @@ _is_connected = false; return writtenLen; } else { - return -1; //Connnection error + return -2; //Connnection error } } return writtenLen; @@ -96,7 +96,7 @@ if (!_blocking) { TimeInterval timeout(_timeout); if (wait_readable(timeout) != 0) - return -1; + return -2; } int n = lwip_recv(_sock_fd, data, length, 0); @@ -126,7 +126,7 @@ _is_connected = false; return readLen; } else { - return -1; //Connnection error + return -2; //Connnection error } } return readLen;