本文整理汇总了C++中ace_asynch_write_stream::Result::act方法的典型用法代码示例。如果您正苦于以下问题:C++ Result::act方法的具体用法?C++ Result::act怎么用?C++ Result::act使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ace_asynch_write_stream::Result
的用法示例。
在下文中一共展示了Result::act方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
JAWS_Asynch_IO::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result)
{
result.message_block ().release ();
if (result.act () == (void *) CONFORMATION)
this->handler_->confirmation_message_complete ();
else
this->handler_->error_message_complete ();
}
示例2: if
void
Sender::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result)
{
ACE_DEBUG ((LM_DEBUG,
"handle_write_stream called\n"));
// Reset pointers.
result.message_block ().rd_ptr (result.message_block ().rd_ptr () - result.bytes_transferred ());
ACE_DEBUG ((LM_DEBUG, "********************\n"));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "bytes_to_write", result.bytes_to_write ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "handle", result.handle ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "bytes_transfered", result.bytes_transferred ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "act", (uintptr_t) result.act ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "success", result.success ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "completion_key", (uintptr_t) result.completion_key ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "error", result.error ()));
ACE_DEBUG ((LM_DEBUG, "********************\n"));
#if 0
ACE_DEBUG ((LM_DEBUG, "%s = %s\n", "message_block", result.message_block ().rd_ptr ()));
#endif
if (result.success ())
{
// Partial write to socket
int unsent_data =
ACE_Utils::truncate_cast<int> (
result.bytes_to_write () - result.bytes_transferred ());
if (unsent_data != 0)
{
// Reset pointers
result.message_block ().rd_ptr (result.bytes_transferred ());
// Duplicate the message block and retry remaining data
if (this->ws_.write (*result.message_block ().duplicate (),
unsent_data) == -1)
{
ACE_ERROR ((LM_ERROR,
"%p\n",
"ACE_Asynch_Write_Stream::write"));
return;
}
}
else if (!(this->file_size_ > this->file_offset_))
{
this->stream_write_done_ = 1;
if (this->transmit_file_done_)
done = 1;
}
}
// Release message block.
result.message_block ().release ();
}
示例3:
void
JAWS_EC_AH_Adapter
::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result)
{
JAWS_Event_Result io_result;
io_result = this->make_io_result ( result
, JAWS_Event_Result::JE_SEND_OK
, JAWS_Event_Result::JE_SEND_FAIL
);
// More useful diagnostics not implemented yet.
void *act = const_cast<void *> (result.act ());
this->completer_->output_complete (io_result, act);
delete this;
}
示例4: handle_write_stream
void Sender::handle_write_stream (const ACE_Asynch_Write_Stream::Result
&result)
{
ACE_DEBUG ((LM_DEBUG,
"handle_write_stream called\n"));
// Reset pointers.
result.message_block ().rd_ptr (result.message_block ().rd_ptr () -
result.bytes_transferred ());
ACE_DEBUG ((LM_DEBUG, "********************\n"));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "bytes_to_write",
result.bytes_to_write ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "handle", result.handle ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "bytes_transfered",
result.bytes_transferred ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "act", (u_long) result.act ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "success", result.success ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "completion_key", (u_long)
result.completion_key ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "error", result.error ()));
ACE_DEBUG ((LM_DEBUG, "********************\n"));
ACE_DEBUG ((LM_DEBUG, "%s = %s\n", "message_block",
result.message_block ().rd_ptr ()));
// Simplify just for Test
if (result.success () && result.bytes_transferred () != 0)
{
if ( duplex != 0 ) // full duplex, continue write
{
initiate_write_stream () ;
}
else // half-duplex read reply, after read we will start
// write
{
initiate_read_stream () ;
}
}
{
ACE_Guard<MyMutex> locker (m_Mtx) ;
nIOCount-- ;
}
}
示例5: locker
void
Receiver::handle_write_stream (const ACE_Asynch_Write_Stream::Result
&result)
{
ACE_DEBUG ((LM_DEBUG, "handle_write_stream called\n"));
ACE_DEBUG ((LM_DEBUG, "********************\n"));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "bytes_to_write",
result.bytes_to_write ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "handle", result.handle ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "bytes_transfered",
result.bytes_transferred ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "act", (u_long) result.act ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "success", result.success ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "completion_key", (u_long)
result.completion_key ()));
ACE_DEBUG ((LM_DEBUG, "%s = %d\n", "error", result.error ()));
ACE_DEBUG ((LM_DEBUG, "********************\n"));
result.message_block ().release ();
if (result.success ())
{
// This code is not robust enough to deal with short file writes
// (which hardly ever happen) ;-)
//ACE_ASSERT (result.bytes_to_write () == result.bytes_transferred ());
if ( duplex == 0 )
{
initiate_read_stream () ;
}
}
{
ACE_Guard<MyMutex> locker (m_Mtx) ;
nIOCount-- ;
}
check_destroy () ;
}