Panda3D
connectionListener.h
1 // Filename: connectionListener.h
2 // Created by: drose (09Feb00)
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 CONNECTIONLISTENER_H
16 #define CONNECTIONLISTENER_H
17 
18 #include "pandabase.h"
19 
20 #include "connectionReader.h"
21 
22 class NetAddress;
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : ConnectionListener
26 // Description : This is a special kind of ConnectionReader that waits
27 // for activity on a rendezvous port and accepts a TCP
28 // connection (instead of attempting to read a datagram
29 // from the rendezvous port).
30 //
31 // It is itself an abstract class, as it doesn't define
32 // what to do with the established connection. See
33 // QueuedConnectionListener.
34 ////////////////////////////////////////////////////////////////////
35 class EXPCL_PANDA_NET ConnectionListener : public ConnectionReader {
36 PUBLISHED:
37  ConnectionListener(ConnectionManager *manager, int num_threads,
38  const string &thread_name = string());
39 
40 protected:
41  virtual void receive_datagram(const NetDatagram &datagram);
42  virtual void connection_opened(const PT(Connection) &rendezvous,
43  const NetAddress &address,
44  const PT(Connection) &new_connection)=0;
45 
46  virtual bool process_incoming_data(SocketInfo *sinfo);
47 
48 private:
49 };
50 
51 #endif
A specific kind of Datagram, especially for sending across or receiving from a network.
Definition: netDatagram.h:43
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...
Represents a single TCP or UDP socket for input or output.
Definition: connection.h:32
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:27