aboutsummaryrefslogtreecommitdiff
path: root/libraries/Ethernet/utility/socket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/Ethernet/utility/socket.cpp')
-rw-r--r--libraries/Ethernet/utility/socket.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/libraries/Ethernet/utility/socket.cpp b/libraries/Ethernet/utility/socket.cpp
index 4875845..fd3e442 100644
--- a/libraries/Ethernet/utility/socket.cpp
+++ b/libraries/Ethernet/utility/socket.cpp
@@ -9,7 +9,6 @@ static uint16_t local_port;
*/
uint8_t socket(SOCKET s, uint8_t protocol, uint16_t port, uint8_t flag)
{
- uint8_t ret;
if ((protocol == SnMR::TCP) || (protocol == SnMR::UDP) || (protocol == SnMR::IPRAW) || (protocol == SnMR::MACRAW) || (protocol == SnMR::PPPOE))
{
close(s);
@@ -144,15 +143,15 @@ uint16_t send(SOCKET s, const uint8_t * buf, uint16_t len)
*
* @return received data size for success else -1.
*/
-uint16_t recv(SOCKET s, uint8_t *buf, uint16_t len)
+int16_t recv(SOCKET s, uint8_t *buf, int16_t len)
{
// Check how much data is available
- uint16_t ret = W5100.getRXReceivedSize(s);
+ int16_t ret = W5100.getRXReceivedSize(s);
if ( ret == 0 )
{
// No data available.
uint8_t status = W5100.readSnSR(s);
- if ( s == SnSR::LISTEN || s == SnSR::CLOSED || s == SnSR::CLOSE_WAIT )
+ if ( status == SnSR::LISTEN || status == SnSR::CLOSED || status == SnSR::CLOSE_WAIT )
{
// The remote end has closed its side of the connection, so this is the eof state
ret = 0;