mirror of
https://github.com/glest/glest-source.git
synced 2025-08-12 19:33:59 +02:00
- attempt to make connection status more reliable and have less hangs when disconnects occur
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user