Browse Source

fixing tcp layer, rels #153

Stasik0 10 years ago
parent
commit
7d040a0bc9
1 changed files with 1 additions and 2 deletions
  1. 1 2
      examples/networklayer_tcp.c

+ 1 - 2
examples/networklayer_tcp.c

@@ -329,8 +329,7 @@ UA_Int32 NetworkLayerTCP_getWork(NetworkLayerTCP *layer, UA_WorkItem **workItems
 #else
         buf.length = read(layer->conLinks[i].sockfd, buf.data, layer->conf.recvBufferSize);
 #endif
-
-        if (errno != 0 || buf.length == 0) {
+        if (buf.length <= 0) {
             closeConnection(layer->conLinks[i].connection); // work is returned in the next iteration
         } else {
             items[j].type = UA_WORKITEMTYPE_BINARYNETWORKMESSAGE;