summaryrefslogtreecommitdiff
path: root/ace/UPIPE_Acceptor.h
blob: 342211444bc6630f2c48cb9c6dfed76ee71eb378 (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
80
81
82
83
84
85
86
87
88
89
/* -*- C++ -*- */
// $Id$


// ============================================================================
//
// = LIBRARY
//    ace
// 
// = FILENAME
//    UPIPE_Acceptor.h
//
// = AUTHOR
//    Gerhard Lenzer and Douglas C. Schmidt
// 
// ============================================================================

#ifndef ACE_UPIPE_ACCEPTOR_H 
#define ACE_UPIPE_ACCEPTOR_H

#include "ace/UPIPE_Stream.h"
#include "ace/Synch.h"
#include "ace/SPIPE_Acceptor.h"
#include "ace/Thread_Manager.h"

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

#if defined (ACE_HAS_THREADS)

class ACE_Export ACE_UPIPE_Acceptor : public ACE_SPIPE_Acceptor
{
  // = TITLE
  //     Defines the format and interface for the listener side of the
  //     ACE_UPIPE_Stream.
public:
  // = Initialization and termination.
  ACE_UPIPE_Acceptor (void);
  // Default constructor.

  ACE_UPIPE_Acceptor (const ACE_UPIPE_Addr &local_sap, 
		      int reuse_addr = 0);
  // Initialize passive endpoint.
  
  int open (const ACE_UPIPE_Addr &local_sap, 
	    int reuse_addr = 0);
  // Initialize passive endpoint.

  ~ACE_UPIPE_Acceptor (void);
  // Close down and release resources.

  int close (void);
  // Close down and release resources.

  int remove (void);
  // Close down and release resources and remove the underlying SPIPE
  // rendezvous point. 

  // = Passive connection acceptance method.
  int accept (ACE_UPIPE_Stream &server_stream, 
	      ACE_UPIPE_Addr *remote_addr = 0,
	      ACE_Time_Value *timeout = 0, 
	      int restart = 1,
              int reset_new_handle = 0);
  // Accept a new data transfer connection.  A <timeout> of 0 means
  // block forever, a <timeout> of {0, 0} means poll.  <restart> == 1
  // means "restart if interrupted."
  
  void dump (void) const;
  // Dump the state of an object.

  ACE_ALLOC_HOOK_DECLARE;
  // Declare the dynamic allocation hooks.

private:
  ACE_Thread_Manager tm;
  // Manage threads.

  ACE_Message_Block mb_;    
  // To confirm connection establishment.
};

#if !defined (ACE_LACKS_INLINE_FUNCTIONS)
#include "ace/UPIPE_Acceptor.i"
#endif

#endif /* ACE_HAS_THREADS */
#endif /* ACE_UPIPE_ACCEPTOR_H */