Skip to content

Commit

Permalink
Further decrease socket flush timeout to 0.05s.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Jun 3, 2014
1 parent 78d9fa5 commit 14d649b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions HarmonyHub.AuthorizationToken
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
KsRE6VVA3xrhtbqFbh0jWn8YTiweDeB/b94Qeqf3ofWGM79zLSr62XQh8geJxw/V
15 changes: 6 additions & 9 deletions csocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ int csocket::resolveHost(const std::string& szRemoteHostName, struct hostent** p
#endif
}

unsigned long uhostname = inet_addr ( szRemoteHostName.c_str() );
*pHostEnt = gethostbyaddr( reinterpret_cast<char *>(&uhostname),
sizeof(unsigned long),
AF_INET);
*pHostEnt = gethostbyname( szRemoteHostName.c_str() );

if (*pHostEnt == NULL)
{
*pHostEnt = gethostbyname( szRemoteHostName.c_str() );
unsigned long uhostname = inet_addr ( szRemoteHostName.c_str() );
*pHostEnt = gethostbyaddr( reinterpret_cast<char *>(&uhostname),
sizeof(unsigned long),
AF_INET);

if (*pHostEnt == NULL)
{
return FAILURE;
Expand Down Expand Up @@ -156,10 +157,6 @@ int csocket::connect( const char* remoteHost, unsigned int remotePort )
setsockopt(m_socket, IPPROTO_TCP, TCP_NODELAY, (char*) &set, sizeof(set) );
#endif

resolveHost(m_strRemoteHost, &pHostEnt);
if (!pHostEnt)
return FAILURE;

m_remoteSocketAddr.sin_family = pHostEnt->h_addrtype;

memcpy(&(m_remoteSocketAddr.sin_addr),
Expand Down

0 comments on commit 14d649b

Please sign in to comment.