summaryrefslogtreecommitdiff
path: root/ACE/tests/Max_Default_Port_Test.h
blob: 70d68dea58673896bd569d0a1b962e5ff94aba83 (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
//=============================================================================
/**
 *  @file    Max_Default_Port_Test.h
 *
 *   This is a test to verify ACE_MAX_DEFAULT_PORT is correct.
 *
 *  @author Chanaka Liyanaarachchi <chanaka@ociweb.com>
 */
//=============================================================================



#ifndef ACE_TESTS_MAX_DEFAULT_PORT_TEST
#define ACE_TESTS_MAX_DEFAULT_PORT_TEST

#include "ace/Event_Handler.h"
#include "ace/SOCK_Acceptor.h"
#include "ace/SOCK_Stream.h"
#include "ace/INET_Addr.h"

/**
 * @class My_Accept_Handler
 = Title
 * A simple event handler
 */
class My_Accept_Handler : public ACE_Event_Handler
{

public:
  My_Accept_Handler (ACE_INET_Addr &addr);
  ~My_Accept_Handler ();

  int open (ACE_INET_Addr &addr);

  ACE_HANDLE get_handle () const;

  int handle_input (ACE_HANDLE handle);

  /// Returns the port the event handler is listening at.
  u_short port ();

private:
  ACE_SOCK_Acceptor peer_acceptor_;

  ACE_SOCK_Stream stream_;

  ACE_INET_Addr addr_;
};

#endif  /* ACE_TESTS_MAX_DEFAULT_PORT_TEST */