Panda3D
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
Public Types | Public Member Functions | List of all members
ISocketStream Class Reference

This is a base class for istreams implemented in Panda that read from a (possibly non-blocking) socket. It adds is_closed(), which can be called after an eof condition to check whether the socket has been closed, or whether more data may be available later. More...

Inheritance diagram for ISocketStream:
Istream SSReader Ios IosBase

Public Types

enum  ReadState { RS_initial = 0, RS_reading = 1, RS_complete = 2, RS_error = 3 }
 
- Public Types inherited from IosBase
enum  Openmode
 
enum  Seekdir { beg = 0, cur = 1, end = 2 }
 

Public Member Functions

 close ()
 
ISocketStream::ReadState getReadState ()
 
bool isClosed ()
 
- Public Member Functions inherited from Istream
int get ()
 
 seekg (Ios::Streamoff off, IosBase::Seekdir dir)
 
 seekg (Ios::Streampos pos)
 
Ios::Streampos tellg ()
 
- Public Member Functions inherited from Ios
bool bad ()
 
 clear ()
 
bool eof ()
 
bool fail ()
 
bool good ()
 
- Public Member Functions inherited from SSReader
 close ()
 
int getTcpHeaderSize ()
 Returns the header size for datagrams. See set_tcp_header_size(). More...
 
bool isClosed ()
 
bool receiveDatagram (Datagram dg)
 Receives a datagram over the socket by expecting a little-endian 16-bit byte count as a prefix. If the socket stream is non-blocking, may return false if the data is not available; otherwise, returns false only if the socket closes. More...
 
 setTcpHeaderSize (int tcp_header_size)
 Sets the header size for datagrams. At the present, legal values for this are 0, 2, or 4; this specifies the number of bytes to use encode the datagram length at the start of each TCP datagram. Sender and receiver must independently agree on this. More...
 

Detailed Description

This is a base class for istreams implemented in Panda that read from a (possibly non-blocking) socket. It adds is_closed(), which can be called after an eof condition to check whether the socket has been closed, or whether more data may be available later.

Member Enumeration Documentation

enum ReadState
Enumerator
RS_initial 
RS_reading 
RS_complete 
RS_error 

Member Function Documentation

close ( )
ISocketStream::ReadState getReadState ( )
bool isClosed ( )