Exemplo n.º 1
0
long
ACE_Proactor::schedule_timer (ACE_Handler &handler,
                              const void *act,
                              const ACE_Time_Value &time,
                              const ACE_Time_Value &interval)
{
  // absolute time.
  ACE_Time_Value absolute_time =
    this->timer_queue_->gettimeofday () + time;

  // Only one guy goes in here at a time
  ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX,
                            ace_mon,
                            this->timer_queue_->mutex (),
                            -1));

  // Remember the old proactor.
  ACE_Proactor *old_proactor = handler.proactor ();

  // Assign *this* Proactor to the handler.
  handler.proactor (this);

  // Schedule the timer
  long result = this->timer_queue_->schedule (&handler,
                                              act,
                                              absolute_time,
                                              interval);
  if (result != -1)
    {
      // no failures: check to see if we are the earliest time
      if (this->timer_queue_->earliest_time () == absolute_time)

        // wake up the timer thread
        if (this->timer_handler_->timer_event_.signal () == -1)
          {
            // Cancel timer
            this->timer_queue_->cancel (result);
            result = -1;
          }
    }

  if (result == -1)
    {
      // Reset the old proactor in case of failures.
      handler.proactor (old_proactor);
    }

  return result;
}
Exemplo n.º 2
0
ACE_SSL_Asynch_Result::ACE_SSL_Asynch_Result (ACE_Handler & handler)
  : A_RESULT (handler.proxy (),
              0,          // act,
              ACE_INVALID_HANDLE,
              0,           // Offset
              0,           // OffsetHigh
              0,           // Priority
              ACE_SIGRTMIN //signal_number
              )
{
}
Exemplo n.º 3
0
int
ACE_Asynch_Operation::open (ACE_Handler &handler,
                            ACE_HANDLE handle,
                            const void *completion_key,
                            ACE_Proactor *proactor)
{
  return this->implementation ()->open (handler.proxy (),
                                        handle,
                                        completion_key,
                                        proactor);
}
Exemplo n.º 4
0
 My_Result (ACE_Handler &handler,
            const void *act,
            int signal_number,
            size_t sequence_number)
   : RESULT_CLASS (handler.proxy (),
                   act,
                   ACE_INVALID_HANDLE,
                   0, // Offset
                   0, // OffsetHigh
                   0, // Priority
                   signal_number),
     sequence_number_ (sequence_number)
   {}
Exemplo n.º 5
0
ACE_SSL_Asynch_Read_Stream_Result::ACE_SSL_Asynch_Read_Stream_Result
  (ACE_Handler &        handler,
   ACE_HANDLE           handle,
   ACE_Message_Block &  message_block,
   size_t               bytes_to_read,
   const void *         act,
   ACE_HANDLE           event,
   int                  priority,
   int                  signal_number
 )
  : ARS_RESULT (handler.proxy (),
                handle,
                message_block,
                bytes_to_read,
                act,
                event,
                priority,
                signal_number
                )
{
}
Exemplo n.º 6
0
ACE_BEGIN_VERSIONED_NAMESPACE_DECL

ACE_SSL_Asynch_Write_Stream_Result::ACE_SSL_Asynch_Write_Stream_Result
  (ACE_Handler &       handler,
   ACE_HANDLE          handle,
   ACE_Message_Block & message_block,
   size_t              bytes_to_write,
   const void *        act,
   ACE_HANDLE          event,
   int                 priority,
   int                 signal_number
 )
  : AWS_RESULT (handler.proxy (),
                handle,
                message_block,
                bytes_to_write,
                act,
                event,
                priority,
                signal_number
                )
{
}