Ejemplo n.º 1
0
void ProactorService::PostRecv()
{
	ACE_Message_Block* pBlock;

	ACE_NEW_NORETURN(pBlock, ACE_Message_Block (2048));
	if(this->m_AsyncReader.read(*pBlock, pBlock->space()) != 0)
	{
		pBlock->release();
		ReserveClose();
	}
}
Ejemplo n.º 2
0
void ProactorService::handle_read_stream( const ACE_Asynch_Read_Stream::Result& result )
{
	ACE_Message_Block& block = result.message_block();
	if (!result.success() || result.bytes_transferred() == 0)
	{
		block.release();
		ReserveClose();
	}
	else
	{
		if (false == ISession::OnReceive(block.rd_ptr(), (unsigned short)block.length(), m_sessionDesc))
		{
			block.release();
			ReserveClose();
			return;
		}

		PostRecv();
	}
}
Ejemplo n.º 3
0
void ProactorService::handle_read_stream( const ACE_Asynch_Read_Stream::Result& Result )
{
	ACE_Message_Block& Block = Result.message_block();
	if(!Result.success() || Result.bytes_transferred() == 0)
	{
		Block.release();
		ReserveClose();
	}
	else
	{
		if(false == ISession::OnReceive(Block.rd_ptr(), Block.length()))
		{
			Block.release();
			ReserveClose();
			return;
		}

		PostRecv();
	}
}