15 #ifndef CONNECTIONREADER_H
16 #define CONNECTIONREADER_H
18 #include "pandabase.h"
20 #include "connection.h"
22 #include "pointerTo.h"
24 #include "lightMutex.h"
27 #include "socket_fdset.h"
28 #include "atomicAdjust.h"
71 const string &thread_name =
string());
75 bool remove_connection(
Connection *connection);
81 INLINE
bool is_polling()
const;
82 int get_num_threads()
const;
84 void set_raw_mode(
bool mode);
85 bool get_raw_mode()
const;
87 void set_tcp_header_size(
int tcp_header_size);
88 int get_tcp_header_size()
const;
93 virtual void flush_read_connection(
Connection *connection);
94 virtual void receive_datagram(
const NetDatagram &datagram)=0;
108 void clear_manager();
109 void finish_socket(SocketInfo *sinfo);
111 virtual bool process_incoming_data(SocketInfo *sinfo);
112 virtual bool process_incoming_udp_data(SocketInfo *sinfo);
113 virtual bool process_incoming_tcp_data(SocketInfo *sinfo);
114 virtual bool process_raw_incoming_udp_data(SocketInfo *sinfo);
115 virtual bool process_raw_incoming_tcp_data(SocketInfo *sinfo);
130 void thread_run(
int thread_index);
132 SocketInfo *get_next_available_socket(
bool allow_block,
133 int current_thread_index);
135 void rebuild_select_list();
140 int _tcp_header_size;
143 class ReaderThread :
public Thread {
147 virtual void thread_main();
170 AtomicAdjust::Integer _currently_polling_thread;
173 friend class ReaderThread;
176 #include "connectionReader.I"
A specific kind of Datagram, especially for sending across or receiving from a network.
Base functionality for a INET domain Socket this call should be the starting point for all other unix...
The primary interface to the low-level networking layer in this package.
A standard mutex, or mutual exclusion lock.
This is an abstract base class for a family of classes that listen for activity on a socket and respo...
A simple place to store and munipulate tcp and port address for communication layer.
A thread; that is, a lightweight process.
This is a standard, non-reentrant mutex, similar to the Mutex class.
Represents a single TCP or UDP socket for input or output.