- attempt to make a few tweaks for more smooth network play

This commit is contained in:
Mark Vejvoda
2011-03-05 20:15:28 +00:00
parent fefed3e3ce
commit 9382473294
3 changed files with 4 additions and 2 deletions

View File

@@ -1380,6 +1380,7 @@ bool Socket::isConnected() {
//if the socket is not writable then it is not conencted
if(isWritable() == false) {
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"[%s::%s Line: %d] ERROR isWritable failed.\n",__FILE__,__FUNCTION__,__LINE__);
return false;
}
//if the socket is readable it is connected if we can read a byte from it
@@ -1387,6 +1388,7 @@ bool Socket::isConnected() {
char tmp;
int err = peek(&tmp, 1, false);
if(err <= 0 && err != PLATFORM_SOCKET_TRY_AGAIN) {
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"[%s::%s Line: %d] ERROR Peek failed, err = %d, error = %s\n",__FILE__,__FUNCTION__,__LINE__,err,getLastSocketErrorFormattedText().c_str());
return false;
}
}