Panda3D
queuedConnectionManager.h
1 // Filename: queuedConnectionManager.h
2 // Created by: drose (09Feb00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef QUEUEDCONNECTIONMANAGER_H
16 #define QUEUEDCONNECTIONMANAGER_H
17 
18 #include "pandabase.h"
19 
20 #include "connectionManager.h"
21 #include "queuedReturn.h"
22 #include "pdeque.h"
23 
24 EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_NET, EXPTP_PANDA_NET, QueuedReturn< PT(Connection) >);
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : QueuedConnectionManager
28 // Description : This flavor of ConnectionManager will queue up all of
29 // the reset-connection messages from the
30 // ConnectionReaders and ConnectionWriters and report
31 // them to the client on demand.
32 //
33 // When a reset connection has been discovered via
34 // reset_connection_available()/get_reset_connection(),
35 // it is still the responsibility of the client to call
36 // close_connection() on that connection to free up its
37 // resources.
38 ////////////////////////////////////////////////////////////////////
39 class EXPCL_PANDA_NET QueuedConnectionManager : public ConnectionManager,
40  public QueuedReturn< PT(Connection) > {
41 PUBLISHED:
44 
45  bool reset_connection_available() const;
46  bool get_reset_connection(PT(Connection) &connection);
47 
48 protected:
49  virtual void connection_reset(const PT(Connection) &connection,
50  bool okflag);
51 };
52 
53 #endif
This flavor of ConnectionManager will queue up all of the reset-connection messages from the Connecti...
The primary interface to the low-level networking layer in this package.
This is the implementation of a family of things that queue up their return values for later retrieva...
Definition: queuedReturn.h:38
Represents a single TCP or UDP socket for input or output.
Definition: connection.h:32