- attempt to make connection status more reliable and have less hangs when disconnects occur

This commit is contained in:
Mark Vejvoda
2013-03-08 08:42:08 +00:00
parent 704935c534
commit e74f747fbd
5 changed files with 139 additions and 26 deletions

View File

@@ -130,6 +130,8 @@ protected:
Mutex *inSocketDestructorSynchAccessor;
bool inSocketDestructor;
bool isSocketBlocking;
public:
Socket(PLATFORM_SOCKET sock);
Socket();
@@ -164,6 +166,7 @@ public:
void setBlock(bool block);
static void setBlock(bool block, PLATFORM_SOCKET socket);
bool getBlock();
bool isReadable();
bool isWritable(struct timeval *timeVal=NULL);
@@ -186,6 +189,17 @@ protected:
static void throwException(string str);
};
class SafeSocketBlockToggleWrapper {
protected:
Socket *socket;
bool originallyBlocked;
bool newBlocked;
public:
SafeSocketBlockToggleWrapper(Socket *socket, bool toggle);
~SafeSocketBlockToggleWrapper();
void Restore();
};
class BroadCastClientSocketThread : public BaseThread
{
private: