Ejemplo n.º 1
0
int32 NetManager::Connect( char* sAddr, int32 nPort, bool bSingleThread)
{
	NetChannelBase* pBase = CreateNewChannel();
	if(!pBase)
		return -1;

	int32 nChannelID = -1;
	pBase->InitChannel( this, m_nSockRcBufSize, m_nRcBufSize, m_nSockRnBufSize, m_nSnBufSize);

	if(pBase->Connect( sAddr, nPort))
	{
		if(bSingleThread)
		{
			AddNewConnection( pBase, false, false);
			ProcNewConnection();
		}
		else
		{
			AddNewConnection( pBase, false, true);
		}

		nChannelID = pBase->GetID();
	}

	FreeChannel( pBase );

	return nChannelID;
}
Ejemplo n.º 2
0
void GSequence::createActions()
{
	m_pActionNewChannel = new QAction(QIcon(":/images/save.png"), tr("New &channel"), this);
	m_pActionNewChannel->setStatusTip(tr("Creates a new channel in the sequence"));
	connect(m_pActionNewChannel, SIGNAL(triggered()), this, SLOT(CreateNewChannel()));

	m_pActionNewEvent = new QAction(QIcon(":/images/save.png"), tr("New &event"), this);
	m_pActionNewEvent->setStatusTip(tr("Creates a new event in the sequence"));
	connect(m_pActionNewEvent, SIGNAL(triggered()), this, SLOT(CreateNewEvent()));
}
Ejemplo n.º 3
0
amqp_channel_t ChannelImpl::GetChannel()
{
    if (m_free_channels.empty())
    {
        return CreateNewChannel();
    }
    else
    {
        amqp_channel_t ret = m_free_channels.front();
        m_free_channels.pop();
        return ret;
    }
}