Panda3D
connectionListener.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 connectionListener.h
10  * @author drose
11  * @date 2000-02-09
12  */
13 
14 #ifndef CONNECTIONLISTENER_H
15 #define CONNECTIONLISTENER_H
16 
17 #include "pandabase.h"
18 
19 #include "connectionReader.h"
20 
21 class NetAddress;
22 
23 /**
24  * This is a special kind of ConnectionReader that waits for activity on a
25  * rendezvous port and accepts a TCP connection (instead of attempting to read
26  * a datagram from the rendezvous port).
27  *
28  * It is itself an abstract class, as it doesn't define what to do with the
29  * established connection. See QueuedConnectionListener.
30  */
31 class EXPCL_PANDA_NET ConnectionListener : public ConnectionReader {
32 PUBLISHED:
33  ConnectionListener(ConnectionManager *manager, int num_threads,
34  const std::string &thread_name = std::string());
35 
36 protected:
37  virtual void receive_datagram(const NetDatagram &datagram);
38  virtual void connection_opened(const PT(Connection) &rendezvous,
39  const NetAddress &address,
40  const PT(Connection) &new_connection)=0;
41 
42  virtual bool process_incoming_data(SocketInfo *sinfo);
43 
44 private:
45 };
46 
47 #endif
A specific kind of Datagram, especially for sending across or receiving from a network.
Definition: netDatagram.h:40
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The primary interface to the low-level networking layer in this package.
This is an abstract base class for a family of classes that listen for activity on a socket and respo...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represents a single TCP or UDP socket for input or output.
Definition: connection.h:29
This is a special kind of ConnectionReader that waits for activity on a rendezvous port and accepts a...
Represents a network address to which UDP packets may be sent or to which a TCP socket may be bound.
Definition: netAddress.h:25