Пример #1
0
//-------------------- Implementation -------------------------
ReactorEndpoint::ReactorEndpoint	(const char* szAddress, EndpointType epType)
{
	m_nMaxConnections = 32;
	int rc = ParseAddress (szAddress, epType);
	OS_Abort_If ((rc<0));

	m_type = epType;
	m_bAutoReconnect = (m_type == ReactorEndpoint::EPTYPE_CLIENT);
}
Пример #2
0
int	ReactorEndpoint::Init		() // alloc the data queue
{
	int rc;
	rc = m_sendQueue.AllocateMemory (m_nSendQueueSize);
	OS_Abort_If ((rc<0));

	rc = m_recvQueue.AllocateMemory (m_nRecvQueueSize);
	OS_Abort_If ((rc<0));

	// prepare the socket
	if (m_type != ReactorEndpoint::EPTYPE_SERVER_CLIENT)
	{
		m_pSock = OS_CreateSocket ();
		rc = m_pSock->Init (m_szHostname, m_nPortNum);
		rc = m_pSock->Create ();
		m_bAutoReconnect = true;
	}
	return 0;
}
Пример #3
0
VCORE_EXPORT	int		vcore_init			(const char* szConfigFileName)
{
	int rc = OS_PlatformInit ();
	OS_Abort_If ((rc<0));
	return theVCore.Init (szConfigFileName);
}