Panda3D
 All Classes Functions Variables Enumerations
datagramSinkNet.h
1 // Filename: datagramSinkNet.h
2 // Created by: drose (15Feb09)
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 DATAGRAMSINKNET_H
16 #define DATAGRAMSINKNET_H
17 
18 #include "pandabase.h"
19 
20 #include "datagramSink.h"
21 #include "connectionWriter.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : DatagramSinkNet
25 // Description : This class accepts datagrams one-at-a-time and sends
26 // them over the net, via a TCP connection.
27 ////////////////////////////////////////////////////////////////////
28 class EXPCL_PANDA_NET DatagramSinkNet : public DatagramSink, public ConnectionWriter {
29 PUBLISHED:
30  DatagramSinkNet(ConnectionManager *manager, int num_threads);
31 
32  INLINE void set_target(Connection *connection);
33  INLINE Connection *get_target() const;
34 
35  // Inherited from DatagramSink
36  virtual bool put_datagram(const Datagram &data);
37  virtual bool is_error();
38  virtual void flush();
39 
40 private:
41  PT(Connection) _target;
42 };
43 
44 #include "datagramSinkNet.I"
45 
46 #endif
The primary interface to the low-level networking layer in this package.
This class accepts datagrams one-at-a-time and sends them over the net, via a TCP connection...
This class defines the abstract interface to sending datagrams to any target, whether it be into a fi...
Definition: datagramSink.h:32
This class handles threaded delivery of datagrams to various TCP or UDP sockets.
Represents a single TCP or UDP socket for input or output.
Definition: connection.h:32
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43