20 INLINE
bool SSReader::
22 #ifdef SIMULATE_NETWORK_DELAY 24 while (do_receive_datagram(dg)) {
27 return get_delayed(dg);
32 if (get_delayed(dg)) {
35 #endif // SIMULATE_NETWORK_DELAY 37 return do_receive_datagram(dg);
46 INLINE
void SSReader::
47 set_tcp_header_size(
int tcp_header_size) {
48 nassertv(tcp_header_size == 0 || tcp_header_size == 2 || tcp_header_size == 4);
49 _tcp_header_size = tcp_header_size;
56 get_tcp_header_size()
const {
57 return _tcp_header_size;
74 INLINE
void SSWriter::
75 set_collect_tcp(
bool collect_tcp) {
76 _collect_tcp = collect_tcp;
82 INLINE
bool SSWriter::
83 get_collect_tcp()
const {
92 INLINE
void SSWriter::
93 set_collect_tcp_interval(
double interval) {
94 _collect_tcp_interval = interval;
102 INLINE
double SSWriter::
103 get_collect_tcp_interval()
const {
104 return _collect_tcp_interval;
113 INLINE
void SSWriter::
114 set_tcp_header_size(
int tcp_header_size) {
115 nassertv(tcp_header_size == 0 || tcp_header_size == 2 || tcp_header_size == 4);
116 _tcp_header_size = tcp_header_size;
122 INLINE
int SSWriter::
123 get_tcp_header_size()
const {
124 return _tcp_header_size;
131 INLINE
bool SSWriter::
141 if (elapsed < 0.0 || elapsed >= _collect_tcp_interval) {
153 INLINE
bool SSWriter::
163 INLINE ISocketStream::
164 ISocketStream(std::streambuf *buf) : std::istream(buf), SSReader(this) {
171 INLINE OSocketStream::
172 OSocketStream(std::streambuf *buf) : std::ostream(buf), SSWriter(this) {
179 INLINE
bool OSocketStream::
181 return SSWriter::flush();
187 INLINE SocketStream::
188 SocketStream(std::streambuf *buf) : std::iostream(buf), SSReader(this), SSWriter(this) {
197 INLINE
void SocketStream::
198 set_tcp_header_size(
int tcp_header_size) {
199 SSReader::set_tcp_header_size(tcp_header_size);
200 SSWriter::set_tcp_header_size(tcp_header_size);
206 INLINE
int SocketStream::
207 get_tcp_header_size()
const {
208 return SSReader::get_tcp_header_size();
215 INLINE
bool SocketStream::
217 return SSWriter::flush();
static TrueClock * get_global_ptr()
Returns a pointer to the one TrueClock object in the world.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...