Skip to content

Commit

Permalink
Merge pull request openframeworks#704 from SnareHanger/master
Browse files Browse the repository at this point in the history
ofxTCPClient receive() connection reset check platform independence
  • Loading branch information
arturoc committed Aug 9, 2011
2 parents b22ef2b + ca951ad commit 275ed04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/ofxNetwork/src/ofxTCPClient.cpp
@@ -1,6 +1,6 @@
#include "ofxTCPClient.h"
#include "ofAppRunner.h"

#include "ofxNetworkUtils.h"

//--------------------------
ofxTCPClient::ofxTCPClient(){
Expand Down Expand Up @@ -189,7 +189,7 @@ string ofxTCPClient::receive(){
}

// check for connection reset or disconnection
if((length==-1 && errno==TCP_CONNRESET ) || length == 0){
if((length==-1 && (ofxNetworkCheckError() == ECONNRESET) ) || length == 0){
close();
if(tmpStr.length()==0) // return if there's no more data left in the buffer
return "";
Expand Down

0 comments on commit 275ed04

Please sign in to comment.