library/src/blockclass/BP-BlockClass.cc
// listens for incomming connections using specified protocol
listens for incomming connections using specified protocol
listens for incomming connections using specified protocol
int Block::SockListen(char * srcAddr, short srcPort, int proto)
{
	if (this->net_handle)
	{
		this->SockClose();
		this->SockDestroy();
		this->net_handle = NULL;
	}
	this->net_handle = BP_NetCreateSocket(srcAddr, srcPort, proto, BP_NETWORK_LISTEN_SOCKET, NULL);
	if (!this->net_handle)
		return ERR_FAILURE;
	return ERR_SUCCESS;
}
int Block :: SockListen ( char * srcAddr , short srcPort , int proto ) { if ( this -> net_handle ) { this -> SockClose ( ) ; this -> SockDestroy ( ) ; this -> net_handle = NULL ; } this -> net_handle = BP_NetCreateSocket ( srcAddr , srcPort , proto , BP_NETWORK_LISTEN_SOCKET , NULL ) ; if ( ! this -> net_handle ) return ERR_FAILURE ; return ERR_SUCCESS ; }
listens for incomming connections using specified protocol
listens for incomming connections using specified protocol
// First see if we have an existing net handle, if we do, close and // destroy resultant data. // close the socket // destroy the socket // set pointer to NULL // create new listener socket // ensure that we created the entwork handle // return indicating success