Esempio n. 1
0
void netadr_t::SetFromSocket( int hSocket )
{	
	Clear();
	type = NA_IP;

	struct sockaddr address;
	int namelen = sizeof(address);
	if ( getsockname( hSocket, (struct sockaddr *)&address, (int *)&namelen) == 0 )
	{
		SetFromSockadr( &address );
	}
}
Esempio n. 2
0
void netadr_t::SetFromSocket( int hSocket )
{	
#if !defined(_X360)
	Clear();
	type = NA_IP;

	struct sockaddr address;
	int namelen = sizeof(address);
	if ( getsockname( hSocket, (struct sockaddr *)&address, (socklen_t *)&namelen) == 0 )
	{
		SetFromSockadr( &address );
	}
#else
	Assert(0);
#endif
}