library/src/network/BP-Network.cc
// Checks to see if a TCP port is open on a host by attempting to connect to it directly.
Checks to see if a TCP port is open on a host by attempting to connect to it directly.
Checks to see if a TCP port is open on a host by attempting to connect to it directly .
BP_BOOL BP_NetTCPPortIsOpen(char *host, unsigned short port)
{
	P_BP_NETWORK_HANDLE new_sock = BP_NetCreateSocket
	(
		(char *) host,
		port,
		IPPROTO_TCP,
		BP_TRUE,
		NULL
	);
	if(new_sock)
	{
		BP_DestroyNetworkHandle(new_sock);
		return BP_FALSE;
	}
	return BP_TRUE;
}
BP_BOOL BP_NetTCPPortIsOpen ( char * host , unsigned short port ) { P_BP_NETWORK_HANDLE new_sock = BP_NetCreateSocket ( ( char * ) host , port , IPPROTO_TCP , BP_TRUE , NULL ) ; if ( new_sock ) { BP_DestroyNetworkHandle ( new_sock ) ; return BP_FALSE ; } return BP_TRUE ; }
Checks to see if a TCP port is open on a host by attempting to connect to it directly.
Checks to see if a TCP port is open on a host by attempting to connect to it directly .
// attempt to create new network socket // If the socket can be opened, it's open, so exit // immediately. // return true indicating that the port is open