Fixed connect.
This commit is contained in:
@@ -139,7 +139,7 @@ bool EzSockets::connect(const std::string& host,unsigned short port) {
|
||||
struct hostent* phe;
|
||||
phe = gethostbyname(host.c_str());
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = (unsigned long) *((LPIN_ADDR*)phe->h_addr_list);
|
||||
addr.sin_addr = *((LPIN_ADDR)* phe->h_addr_list);
|
||||
addr.sin_port = htons(port);
|
||||
#else
|
||||
addr.sin_family = AF_INET;
|
||||
@@ -147,7 +147,7 @@ bool EzSockets::connect(const std::string& host,unsigned short port) {
|
||||
inet_pton(AF_INET,host.c_str(),&addr.sin_addr);
|
||||
#endif
|
||||
|
||||
if(::connect(sock,(struct sockaddr*)&addr,sizeof(addr))<=0)
|
||||
if(::connect(sock,(struct sockaddr*)&addr,sizeof(addr))!=0)
|
||||
return false;
|
||||
|
||||
state = skCONNECTED;
|
||||
|
||||
Reference in New Issue
Block a user