Panda3D
|
00001 // Filename: datagramSinkNet.h 00002 // Created by: drose (15Feb09) 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 DATAGRAMSINKNET_H 00016 #define DATAGRAMSINKNET_H 00017 00018 #include "pandabase.h" 00019 00020 #include "datagramSink.h" 00021 #include "connectionWriter.h" 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Class : DatagramSinkNet 00025 // Description : This class accepts datagrams one-at-a-time and sends 00026 // them over the net, via a TCP connection. 00027 //////////////////////////////////////////////////////////////////// 00028 class EXPCL_PANDA_NET DatagramSinkNet : public DatagramSink, public ConnectionWriter { 00029 PUBLISHED: 00030 DatagramSinkNet(ConnectionManager *manager, int num_threads); 00031 00032 INLINE void set_target(Connection *connection); 00033 INLINE Connection *get_target() const; 00034 00035 // Inherited from DatagramSink 00036 virtual bool put_datagram(const Datagram &data); 00037 virtual bool is_error(); 00038 virtual void flush(); 00039 00040 private: 00041 PT(Connection) _target; 00042 }; 00043 00044 #include "datagramSinkNet.I" 00045 00046 #endif