CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

iNetworkConnection Struct Reference

This is a network connection interface. More...

#include <driver.h>

Inheritance diagram for iNetworkConnection:

iNetworkEndPoint iBase List of all members.

Public Methods

virtual bool Send (const char *data, size_t nbytes)=0
 Send nbytes of data over the connection.

virtual bool IsConnected () const=0
 See if the connection is still connected.

virtual size_t Receive (void *buff, size_t maxbytes)=0
 Receive data from the connection.

virtual size_t Receive (void *buff, size_t maxbytes, csRef< iString > &from)=0
 This version of Receive() is valid only for multicast connections.

virtual bool IsDataWaiting () const=0
 This provides a lightweight alternative to performing brute-force polling of Receive() to find out if any data is available.


Detailed Description

This is a network connection interface.

It represents a single network connection. All network connections must implement this interface.

Definition at line 98 of file driver.h.


Member Function Documentation

virtual bool iNetworkConnection::IsConnected   [pure virtual]
 

See if the connection is still connected.

virtual bool iNetworkConnection::IsDataWaiting   [pure virtual]
 

This provides a lightweight alternative to performing brute-force polling of Receive() to find out if any data is available.

This method will never block. You should call this function first to see if data is available, and only call Receive() if true is returned.

virtual size_t iNetworkConnection::Receive void *    buff,
size_t    maxbytes,
csRef< iString > &    from
[pure virtual]
 

This version of Receive() is valid only for multicast connections.

It returns a 'from' parameter indicating the sender of the data.

virtual size_t iNetworkConnection::Receive void *    buff,
size_t    maxbytes
[pure virtual]
 

Receive data from the connection.

If the endpoint is configured to block, then the function does not return until data has been read, an error has occurred, or the connection was closed. If non-blocking, then Receive() returns immediately. If data is available then, it returns the number of bytes read (<= maxbytes). If data is not available and the connection is non-blocking, then it returns 0 and GetLastError() returns CS_NET_ERR_NO_ERROR.

virtual bool iNetworkConnection::Send const char *    data,
size_t    nbytes
[pure virtual]
 

Send nbytes of data over the connection.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18