Made the callback work. Updated error messages.

This commit is contained in:
lotodore
2007-02-18 19:16:34 +00:00
parent a97a1df8f7
commit 4e40f11f90
6 changed files with 63 additions and 42 deletions
+3 -3
View File
@@ -58,8 +58,8 @@ ClientStateInit::Process(ClientThread &client)
if (data.serverAddr.empty())
throw ClientException(ERR_SOCK_SERVERADDR_NOT_SET, 0);
if (data.serverPort < 1024)
throw ClientException(ERR_SOCK_INVALID_PORT, 0);
// if (data.serverPort < 1024)
// throw ClientException(ERR_SOCK_INVALID_PORT, 0);
data.sockfd = socket(data.addrFamily, SOCK_STREAM, 0);
if (!IS_VALID_SOCKET(data.sockfd))
@@ -161,7 +161,7 @@ ClientStateConnect::Process(ClientThread &client)
client.SetState(ClientStateFinal::Instance());
return MSG_SOCK_RESOLVE_DONE;
return MSG_SOCK_CONNECT_DONE;
}
//-----------------------------------------------------------------------------
+6 -4
View File
@@ -22,10 +22,10 @@
#define ERR_SOCK_SERVERADDR_NOT_SET 1
#define ERR_SOCK_INVALID_PORT 2
#define ERR_SOCK_CREATION_FAILED 10
#define ERR_SOCK_SET_PORT_FAILED 11
#define ERR_SOCK_RESOLVE_FAILED 12
#define ERR_SOCK_CONNECT_FAILED 13
#define ERR_SOCK_CREATION_FAILED 3
#define ERR_SOCK_SET_PORT_FAILED 4
#define ERR_SOCK_RESOLVE_FAILED 5
#define ERR_SOCK_CONNECT_FAILED 6
// This is an internal message which is not reported.
#define MSG_SOCK_INTERNAL_PENDING 0
@@ -35,5 +35,7 @@
#define MSG_SOCK_RESOLVE_DONE 2
#define MSG_SOCK_CONNECT_DONE 3
#define MSG_SOCK_LAST MSG_SOCK_CONNECT_DONE
#endif