BugFix: Network can not handle EPIPE error. Issue#35 #36

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2016-10-07 18:55:03 +09:00
parent d834a1a65b
commit 9de0448130
13 changed files with 246 additions and 252 deletions

View File

@@ -184,9 +184,10 @@ int MQTTGWPacket::recv(Network* network)
unsigned char c;
/* read First Byte of Packet */
if (network->recv((unsigned char*)&_header.byte, 1) == -1)
int rc = network->recv((unsigned char*)&_header.byte, 1);
if ( rc <= 0)
{
return -1;
return rc;
}
/* read RemainingLength */
do