Panda3D
|
This is a base class for istreams implemented in Panda that read from a (possibly non-blocking) socket. More...
Public Types | |
enum | openmode |
enum | ReadState { RSInitial = 0, RSReading = 1, RSComplete = 2, RSError = 3 } |
enum | seekdir { beg = 0, cur = 1, end = 2 } |
Public Member Functions | |
bool | bad () |
clear () | |
close () | |
bool | eof () |
bool | fail () |
int | get () |
ReadState | getReadState () |
int | getTcpHeaderSize () |
Returns the header size for datagrams. | |
bool | good () |
bool | isClosed () |
bool | receiveDatagram (Datagram dg) |
Receives a datagram over the socket by expecting a little-endian 16-bit byte count as a prefix. | |
seekg (unsigned long int pos) | |
seekg (long int off, seekdir dir) | |
setTcpHeaderSize (int tcp_header_size) | |
Sets the header size for datagrams. | |
unsigned long int | tellg () |
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.
enum openmode [inherited] |
enum ReadState |
enum seekdir [inherited] |
bool bad | ( | ) | [inherited] |
clear | ( | ) | [inherited] |
close | ( | ) |
Reimplemented from SSReader.
bool eof | ( | ) | [inherited] |
bool fail | ( | ) | [inherited] |
int get | ( | ) | [inherited] |
ReadState getReadState | ( | ) |
int getTcpHeaderSize | ( | ) | [inherited] |
bool good | ( | ) | [inherited] |
bool isClosed | ( | ) |
Reimplemented from SSReader.
bool receiveDatagram | ( | Datagram | dg | ) | [inherited] |
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.
seekg | ( | unsigned long int | pos | ) | [inherited] |
setTcpHeaderSize | ( | int | tcp_header_size | ) | [inherited] |
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.
Reimplemented in SocketStream.
unsigned long int tellg | ( | ) | [inherited] |