コード例 #1
0
ファイル: QtReactor_Test.cpp プロジェクト: DOCGroup/ACE_TAO
int DgramHandler::handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask)
{
  if (peer_.get_handle () != handle )
    ACE_ERROR ((LM_ERROR,
                ACE_TEXT ("Unknown handle %d DgramHandler::handle_close "
                          "with mask %x. My handle is %d\n"),
                handle,
                close_mask,
                peer_.get_handle ()));
  else
    peer_.close ();

  return 0;
}
コード例 #2
0
ファイル: U_Test.cpp プロジェクト: binghuo365/BaseLab
int
DSession::open (const ACE_INET_Addr & local,
                const ACE_INET_Addr & remote)
{
  {
    ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, monitor, this->lock_, -1);

    ACE_SOCK_Dgram dgram;

    if (dgram.open(local) == -1)
      ACE_ERROR ((LM_ERROR,
              ACE_TEXT ("(%t) %s=%d open error 1\n"),
              this->get_name (),
              this->index ()));

    else if (this->stream_.open (*this, 
                                dgram.get_handle(),
                                0, // completion key,
                                this->owner_.task().get_proactor(this->index()),
                                1) == -1)
      ACE_ERROR((LM_ERROR,
              ACE_TEXT ("(%t) %s=%d open error 2\n"),
              this->get_name (),
              this->index ()));
    else
      this->on_open(local, remote);

    if (this->io_count_r_ != 0 || 
        this->io_count_w_ != 0 ||
        this->post_count_ != 0 )
      return 0;
  }
  delete this;
  return -1;
}
コード例 #3
0
ファイル: QtReactor_Test.cpp プロジェクト: DOCGroup/ACE_TAO
ACE_HANDLE DgramHandler::get_handle () const
{
  return peer_.get_handle ();
}