Panda3D

datagramSinkNet.h
Go to the documentation of this file.
1 /**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file datagramSinkNet.h
10 * @author drose
11 * @date 2009-02-15
12 */
13
14 #ifndef DATAGRAMSINKNET_H
15 #define DATAGRAMSINKNET_H
16
17 #include "pandabase.h"
18
19 #include "datagramSink.h"
20 #include "connectionWriter.h"
21
22 /**
23 * This class accepts datagrams one-at-a-time and sends them over the net, via
24 * a TCP connection.
25 */
26 class EXPCL_PANDA_NET DatagramSinkNet : public DatagramSink, public ConnectionWriter {
27 PUBLISHED:
28 explicit DatagramSinkNet(ConnectionManager *manager, int num_threads);
29
30 INLINE void set_target(Connection *connection);
31 INLINE Connection *get_target() const;
32
33 // Inherited from DatagramSink
34 virtual bool put_datagram(const Datagram &data);
35 virtual bool is_error();
36 virtual void flush();
37
38 private:
39 PT(Connection) _target;
40 };
41
42 #include "datagramSinkNet.I"
43
44 #endif
ConnectionManager
The primary interface to the low-level networking layer in this package.
Definition: connectionManager.h:41
ConnectionWriter
This class handles threaded delivery of datagrams to various TCP or UDP sockets.
Definition: connectionWriter.h:35
Connection
Represents a single TCP or UDP socket for input or output.
Definition: connection.h:29
DatagramSinkNet
This class accepts datagrams one-at-a-time and sends them over the net, via a TCP connection.
Definition: datagramSinkNet.h:26
DatagramSink
This class defines the abstract interface to sending datagrams to any target, whether it be into a fi...
Definition: datagramSink.h:29
Datagram
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38
connectionWriter.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
datagramSinkNet.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
datagramSink.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.