Panda3D
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. More...

Inheritance diagram for ISocketStream:
Istream SSReader BasicIosChar IosBase

Public Types

enum  ReadState { RS_initial = 0, RS_reading = 1, RS_complete = 2, RS_error = 3 }
 
- Public Types inherited from IosBase
enum  Iostate
 
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 (Streamoff pos)
 
 seekg (Streamoff off, IosBase::Seekdir dir)
 
Streamoff tellg ()
 
- Public Member Functions inherited from BasicIosChar
bool bad ()
 
 clear ()
 
bool eof ()
 
bool fail ()
 
bool good ()
 
- Public Member Functions inherited from SSReader
 close ()
 
int getTcpHeaderSize ()
 Returns the header size for datagrams. 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. More...
 
 setTcpHeaderSize (int tcp_header_size)
 Sets the header size for datagrams. 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

◆ ReadState

enum ReadState
Enumerator
RS_initial 
RS_reading 
RS_complete 
RS_error 

Member Function Documentation

◆ close()

close ( )

◆ getReadState()

ISocketStream::ReadState getReadState ( )

◆ isClosed()

bool isClosed ( )