Panda3D
|
00001 // Filename: queuedConnectionManager.h 00002 // Created by: drose (09Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef QUEUEDCONNECTIONMANAGER_H 00016 #define QUEUEDCONNECTIONMANAGER_H 00017 00018 #include "pandabase.h" 00019 00020 #include "connectionManager.h" 00021 #include "queuedReturn.h" 00022 #include "pdeque.h" 00023 00024 EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_NET, EXPTP_PANDA_NET, QueuedReturn< PT(Connection) >); 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : QueuedConnectionManager 00028 // Description : This flavor of ConnectionManager will queue up all of 00029 // the reset-connection messages from the 00030 // ConnectionReaders and ConnectionWriters and report 00031 // them to the client on demand. 00032 // 00033 // When a reset connection has been discovered via 00034 // reset_connection_available()/get_reset_connection(), 00035 // it is still the responsibility of the client to call 00036 // close_connection() on that connection to free up its 00037 // resources. 00038 //////////////////////////////////////////////////////////////////// 00039 class EXPCL_PANDA_NET QueuedConnectionManager : public ConnectionManager, 00040 public QueuedReturn< PT(Connection) > { 00041 PUBLISHED: 00042 QueuedConnectionManager(); 00043 ~QueuedConnectionManager(); 00044 00045 bool reset_connection_available() const; 00046 bool get_reset_connection(PT(Connection) &connection); 00047 00048 protected: 00049 virtual void connection_reset(const PT(Connection) &connection, 00050 bool okflag); 00051 }; 00052 00053 #endif