00001 // Filename: connectionListener.h 00002 // Created by: drose (09Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef CONNECTIONLISTENER_H 00020 #define CONNECTIONLISTENER_H 00021 00022 #include <pandabase.h> 00023 00024 #include "connectionReader.h" 00025 00026 class NetAddress; 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Class : ConnectionListener 00030 // Description : This is a special kind of ConnectionReader that waits 00031 // for activity on a rendezvous port and accepts a TCP 00032 // connection (instead of attempting to read a datagram 00033 // from the rendezvous port). 00034 // 00035 // It is itself an abstract class, as it doesn't define 00036 // what to do with the established connection. See 00037 // QueuedConnectionListener. 00038 //////////////////////////////////////////////////////////////////// 00039 class EXPCL_PANDA ConnectionListener : public ConnectionReader { 00040 PUBLISHED: 00041 ConnectionListener(ConnectionManager *manager, int num_threads); 00042 00043 protected: 00044 virtual void receive_datagram(const NetDatagram &datagram); 00045 virtual void connection_opened(const PT(Connection) &rendezvous, 00046 const NetAddress &address, 00047 const PT(Connection) &new_connection)=0; 00048 00049 virtual void process_incoming_data(SocketInfo *sinfo); 00050 00051 private: 00052 }; 00053 00054 #endif