summaryrefslogtreecommitdiff
path: root/apps/Gateway/Gateway/Thr_Proxy_Handler.h
blob: 275bc87b32000fdee9f80d3941776881f5e54501 (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
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    apps
// 
// = FILENAME
//    Thr_Proxy_Handler.h
//
// = AUTHOR
//    Doug Schmidt 
// 
// ============================================================================

#if !defined (_THR_IO_HANDLER)
#define _THR_IO_HANDLER

#include "Proxy_Handler.h"

#if defined (ACE_HAS_THREADS)
class Thr_Consumer_Proxy : public Consumer_Proxy
  // = TITLE
  //    Runs each Output Proxy_Handler in a separate thread.
{
public:
  Thr_Consumer_Proxy (ACE_Event_Channel &, 
		      const ACE_INET_Addr &remote_addr,
		      const ACE_INET_Addr &local_addr,
		      ACE_INT32 conn_id);

  virtual int open (void *);
  // Initialize the threaded Consumer_Proxy object and spawn a new
  // thread.

  virtual int put (ACE_Message_Block *, ACE_Time_Value * = 0);
  // Send a message to a peer.

protected:
  virtual int handle_input (ACE_HANDLE);
  // Called when Peer shutdown unexpectedly.

  virtual int svc (void);
  // Transmit peer messages.
};

class Thr_Supplier_Proxy : public Supplier_Proxy
  // = TITLE
  //    Runs each Input Proxy_Handler in a separate thread.
{
public:
  Thr_Supplier_Proxy (ACE_Event_Channel &, 
		      const ACE_INET_Addr &remote_addr,
		      const ACE_INET_Addr &local_addr,
		      ACE_INT32 conn_id);

  virtual int open (void *);
  // Initialize the object and spawn a new thread.

protected:
  virtual int svc (void);
  // Transmit peer messages.
};
#endif /* ACE_HAS_THREADS */
#endif /* _THR_IO_HANDLER */