1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Allow specifying network port in server.

This commit is contained in:
Bartosz Taudul
2019-09-21 15:43:01 +02:00
parent fb63dd89bc
commit 82cd667b30
10 changed files with 58 additions and 23 deletions
+5 -2
View File
@@ -86,7 +86,7 @@ Socket::~Socket()
}
}
bool Socket::Connect( const char* addr, const char* port )
bool Socket::Connect( const char* addr, int port )
{
assert( m_sock == -1 );
@@ -97,7 +97,10 @@ bool Socket::Connect( const char* addr, const char* port )
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
if( getaddrinfo( addr, port, &hints, &res ) != 0 ) return false;
char portbuf[32];
sprintf( portbuf, "%i", port );
if( getaddrinfo( addr, portbuf, &hints, &res ) != 0 ) return false;
int sock = 0;
for( ptr = res; ptr; ptr = ptr->ai_next )
{