![]() |
Public API Reference |
#include <driver.h>
Inheritance diagram for iNetworkConnection:
Public Methods | |
virtual bool | Send (const char *data, size_t nbytes)=0 |
Send nbytes of data over the connection. More... | |
virtual bool | IsConnected () const=0 |
See if the connection is still connected. More... | |
virtual size_t | Receive (void *buff, size_t maxbytes)=0 |
Receive data from the connection. More... | |
virtual size_t | Receive (void *buff, size_t maxbytes, csRef< iString > &from)=0 |
This version of Receive() is valid only for multicast connections. More... | |
virtual bool | IsDataWaiting () const=0 |
This provides a lightweight alternative to bruteforce polling Receive in case there are any data to read. More... |
It represents a single network connection. All network connections must implement this interface.
Definition at line 92 of file inetwork/driver.h.
|
See if the connection is still connected.
|
|
This provides a lightweight alternative to bruteforce polling Receive in case there are any data to read. You should call this function first to see if there are data waiting, and only call Receive if it returns true. |
|
This version of Receive() is valid only for multicast connections. It returns a 'from' parameter indicating the sender of the data. |
|
Receive data from the connection. If the endpoint is in blocking mode, then the function does not return until data has been read, an error has occurred, or the connection was closed. In non-blocking mode, Receive returns immediately. If data is available then it returns the number of bytes (<= maxbytes) which was read. If data is not available and the connection is non-blocking, then it returns 0 and GetLastError() returns CS_NET_ERR_NO_ERROR. |
|
Send nbytes of data over the connection.
|