summaryrefslogtreecommitdiff
path: root/ace/SSL/SSL_Connect_Handler.h
blob: e2f2822cad0aa6c480f3ea59f1332a473cf7a580 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// -*- C++ -*-

//=============================================================================
/**
 *  @file SSL_Connect_Handler.h
 *
 *  $Id$
 *
 *  @author Ossama Othman <ossama@uci.edu>
 */
//=============================================================================


#ifndef ACE_SSL_CONNECT_HANDLER_H
#define ACE_SSL_CONNECT_HANDLER_H

#include "ace/pre.h"

#include "SSL_Export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/Event_Handler.h"

class ACE_SSL_SOCK_Stream;

/**
 * @class ACE_SSL_Connect_Handler
 *
 * @brief Event handler designed to complete non-blocking active
 *        connections.
 *
 *
 */
class ACE_SSL_Connect_Handler : public ACE_Event_Handler
{
public:

  /// Constructor.
  ACE_SSL_Connect_Handler (ACE_SSL_SOCK_Stream &ssl_stream);

  /// Destructor.
  virtual ~ACE_SSL_Connect_Handler (void);

  /// Get the handle associated with this event handler.
  virtual ACE_HANDLE get_handle (void) const;

  /// Called when input events occur (e.g., connection or data).
  virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE);

  /// Called when output events are possible (e.g., flow control
  /// abates).
  virtual int handle_output (ACE_HANDLE fd = ACE_INVALID_HANDLE);

  /// Called when a handle_*() method returns -1 or when the
  /// remove_handler() method is called on an ACE_Reactor.  The
  /// close_mask indicates which event has triggered the
  /// handle_close() method callback on a particular handle.
  virtual int handle_close (ACE_HANDLE handle,
                            ACE_Reactor_Mask close_mask);

private:

  /// Perform the SSL connect.
  int ssl_connect (void);

private:

  /// Reference to the SSL_SOCK_Stream for which the active
  /// connection is being established.
  ACE_SSL_SOCK_Stream &ssl_stream_;
};


#include "ace/post.h"

#endif	/* ACE_SSL_CONNECT_HANDLER_H */