Panda3D
Public Member Functions | List of all members
OSocketStream Class Reference

A base class for ostreams that write to a (possibly non-blocking) socket. More...

Inheritance diagram for OSocketStream:
Ostream SSWriter BasicIosChar IosBase

Public Member Functions

 close ()
 
bool flush ()
 Sends the most recently queued data now. More...
 
bool isClosed ()
 
- Public Member Functions inherited from Ostream
 flush ()
 
 put (char c)
 
 seekp (Streamoff pos)
 
 seekp (Streamoff off, IosBase::Seekdir dir)
 
Streamoff tellp ()
 
- Public Member Functions inherited from BasicIosChar
bool bad ()
 
 clear ()
 
bool eof ()
 
bool fail ()
 
bool good ()
 
- Public Member Functions inherited from SSWriter
 close ()
 
bool considerFlush ()
 Sends the most recently queued data if enough time has elapsed. More...
 
bool flush ()
 Sends the most recently queued data now. More...
 
bool getCollectTcp ()
 Returns the current setting of "collect-tcp" mode. More...
 
double getCollectTcpInterval ()
 Returns the interval in time, in seconds, for which to hold TCP packets before sending all of the recently received packets at once. More...
 
int getTcpHeaderSize ()
 Returns the header size for datagrams. More...
 
bool isClosed ()
 
bool sendDatagram (const Datagram dg)
 Transmits the indicated datagram over the socket by prepending it with a little-endian 16-bit byte count. More...
 
 setCollectTcp (bool collect_tcp)
 Enables or disables "collect-tcp" mode. More...
 
 setCollectTcpInterval (double interval)
 Specifies the interval in time, in seconds, for which to hold TCP packets before sending all of the recently received packets at once. More...
 
 setTcpHeaderSize (int tcp_header_size)
 Sets the header size for datagrams. More...
 

Additional Inherited Members

- Public Types inherited from IosBase
enum  Iostate
 
enum  Openmode
 
enum  Seekdir { beg = 0, cur = 1, end = 2 }
 

Detailed Description

A base class for ostreams that write to a (possibly non-blocking) socket.

It adds is_closed(), which can be called after any write operation fails to check whether the socket has been closed, or whether more data may be sent later.

Member Function Documentation

◆ close()

close ( )

◆ flush()

bool flush ( )

Sends the most recently queued data now.

This only has meaning if set_collect_tcp() has been set to true.

◆ isClosed()

bool isClosed ( )