summaryrefslogtreecommitdiff
path: root/ace/SPIPE_Acceptor.h
blob: 8036c808618ce903a2eac4e39afcc67e3c694d07 (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
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    ace
// 
// = FILENAME
//    SPIPE_Acceptor.h
//
// = AUTHOR
//    Doug Schmidt and Prashant Jain
// 
// ============================================================================

#if !defined (ACE_SPIPE_ACCEPTOR_H) 
#define ACE_SPIPE_ACCEPTOR_H

#include "ace/SPIPE_Stream.h"
#if defined (ACE_WIN32)
#include "ace/Synch.h"
#endif /* ACE_WIN32 */


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

  ACE_SPIPE_Acceptor (const ACE_SPIPE_Addr &local_sap, 
		      int reuse_addr = 1,
		      int perms = ACE_DEFAULT_FILE_PERMS);
  // Initiate a passive-mode STREAM pipe listener.

  int open (const ACE_SPIPE_Addr &local_sap,
	    int reuse_addr = 1,
	    int perms = ACE_DEFAULT_FILE_PERMS);
  // Initiate a passive-mode STREAM pipe listener.

  int close (void);
  // Close down the passive-mode STREAM pipe listener.

  int remove (void);
  // Remove the underlying mounted pipe from the file system.

  // = Passive connection acceptance method.
  int accept (ACE_SPIPE_Stream &ipc_sap_spipe, 
	      ACE_SPIPE_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."

  // = Meta-type info
  typedef ACE_SPIPE_Addr PEER_ADDR;
  typedef ACE_SPIPE_Stream PEER_STREAM;

  void dump (void) const;
  // Dump the state of an object.

  ACE_ALLOC_HOOK_DECLARE;
  // Declare the dynamic allocation hooks.

private:
  int create_new_instance (int perms = 0);
  // Create a new instance of an SPIPE.

#if (defined (ACE_WIN32) && defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0))
  ACE_OVERLAPPED	overlapped_;
  ACE_Manual_Event	event_;
  char			already_connected_;
#endif /* ACE_WIN32 */

};

#endif /* ACE_SPIPE_ACCEPTOR_H */