Connect is now non-blocking. Fixed problem in resolver thread where socket was closed.

This commit is contained in:
lotodore
2007-02-25 18:22:19 +00:00
parent d63588f54b
commit 82cf963f0a
6 changed files with 117 additions and 23 deletions
+23 -5
View File
@@ -101,14 +101,32 @@ private:
ResolverThread *m_resolver;
};
// State: Connecting to server.
class ClientStateConnect : public ClientState
// State: Initiate server connection.
class ClientStateStartConnect : public ClientState
{
public:
// Access the state singleton.
static ClientStateConnect &Instance();
static ClientStateStartConnect &Instance();
virtual ~ClientStateConnect();
virtual ~ClientStateStartConnect();
// Call connect.
virtual int Process(ClientThread &client);
protected:
// Protected constructor - this is a singleton.
ClientStateStartConnect();
};
// State: Connecting to server.
class ClientStateConnecting : public ClientState
{
public:
// Access the state singleton.
static ClientStateConnecting &Instance();
virtual ~ClientStateConnecting();
// "Poll" for the completion of the TCP/IP connect call.
virtual int Process(ClientThread &client);
@@ -116,7 +134,7 @@ public:
protected:
// Protected constructor - this is a singleton.
ClientStateConnect();
ClientStateConnecting();
};
// State: Final (TODO).