VCF::SocketPeer Class Reference
An abstract class that represents a platform socket implementation. More...
#include <vcf/NetworkKit/Socket.h>
Inheritance diagram for VCF::SocketPeer:

Public Member Functions | |
| virtual | ~SocketPeer () |
| virtual void | setPeerOwner (Socket *socket)=0 |
| virtual int | create ()=0 |
| virtual int | close ()=0 |
| Closes the OS specific socket handle and releases any resources associated with it. | |
| virtual int | connect (const String &host, const unsigned short port)=0 |
| virtual int | listen (unsigned short port)=0 |
| virtual SocketPeer * | accept ()=0 |
| Accepts a new connection and returns a new socket peer instance. | |
| virtual int | recv (unsigned char *bytes, size_t bytesLength)=0 |
| virtual int | send (const unsigned char *bytes, size_t bytesLength)=0 |
| virtual int | recvFrom (unsigned char *bytes, size_t bytesLength, IPEndPoint &fromAddr)=0 |
| virtual int | sendTo (const unsigned char *bytes, size_t bytesLength, const IPEndPoint &toAddr)=0 |
| virtual OSHandleID | getHandleID ()=0 |
| Returns a handle for the OS specific socket resource. | |
| virtual IPAddress | getLocalHostIPAddress ()=0 |
| Returns the IP address of the local host as a string formatted (for IPV4 at least) as 4 "octets", each separated by the "." character. | |
| virtual IPAddress | getRemoteHostIPAddress ()=0 |
| Returns the IP address of the remote host as a string formatted (for IPV4 at least) as 4 "octets", each separated by the "." character. | |
| virtual unsigned short | getLocalPort ()=0 |
| Returns the local port number for this socket instance. | |
| virtual unsigned short | getRemotePort ()=0 |
| Returns the remote port number for this socket instance. | |
| virtual void | setOptions (Dictionary &options)=0 |
| Sets the options for a socket. | |
| virtual Dictionary | getOptions ()=0 |
| Returns a dictionary containing the options for the socket. | |
| virtual bool | wouldOperationBlock ()=0 |
| Indicates whether the current operation would block. | |
| virtual void | select (uint32 timeout, SocketArray *readSockets, SocketArray *writeSockets, SocketArray *errorSockets)=0 |
| performs a select, using the various read, write, and/or error socket lists. | |
Detailed Description
An abstract class that represents a platform socket implementation.This needs to be implemented for each platform that the NetworkKit is portetd to. A typical implementation may use the BSD socket API as a base implementation.
Constructor & Destructor Documentation
|
|
|
Member Function Documentation
|
|
Accepts a new connection and returns a new socket peer instance. Assumes the listen() call has already occurred. If it has not then an exception is thrown. Implemented in VCF::Win32SocketPeer, and VCF::Win32UDPSocketPeer. |
|
|
Closes the OS specific socket handle and releases any resources associated with it.
Implemented in VCF::Win32SocketPeer. |
|
||||||||||||
|
Implemented in VCF::Win32SocketPeer, and VCF::Win32UDPSocketPeer. |
|
|
Implemented in VCF::Win32SocketPeer, and VCF::Win32UDPSocketPeer. |
|
|
Returns a handle for the OS specific socket resource. This is typically a socket handle or descriptor, depending on the OS and the underlying implementation. Implemented in VCF::Win32SocketPeer. |
|
|
Returns the IP address of the local host as a string formatted (for IPV4 at least) as 4 "octets", each separated by the "." character. Each octet is a number string in the range from 0 to 255. Implemented in VCF::Win32SocketPeer. |
|
|
Returns the local port number for this socket instance.
Implemented in VCF::Win32SocketPeer. |
|
|
Returns a dictionary containing the options for the socket.
Implemented in VCF::Win32SocketPeer. |
|
|
Returns the IP address of the remote host as a string formatted (for IPV4 at least) as 4 "octets", each separated by the "." character. Each octet is a number string in the range from 0 to 255. Implemented in VCF::Win32SocketPeer, and VCF::Win32UDPSocketPeer. |
|
|
Returns the remote port number for this socket instance.
Implemented in VCF::Win32SocketPeer, and VCF::Win32UDPSocketPeer. |
|
|
Implemented in VCF::Win32SocketPeer, and VCF::Win32UDPSocketPeer. |
|
||||||||||||
|
Implemented in VCF::Win32SocketPeer, and VCF::Win32UDPSocketPeer. |
|
||||||||||||||||
|
Implemented in VCF::Win32SocketPeer, and VCF::Win32UDPSocketPeer. |
|
||||||||||||||||||||
|
performs a select, using the various read, write, and/or error socket lists. Will block for a maximum of timeout milliseconds. If the all the read, write, and error socket arrays are NULL, then the select is performed only on the socket instance itself.
Implemented in VCF::Win32SocketPeer. |
|
||||||||||||
|
Implemented in VCF::Win32SocketPeer, and VCF::Win32UDPSocketPeer. |
|
||||||||||||||||
|
Implemented in VCF::Win32SocketPeer, and VCF::Win32UDPSocketPeer. |
|
|
Sets the options for a socket. The options are stored as a dictionary of items, with the keys being 1 or more values represented by the Socket::soXXX const string variables. Implemented in VCF::Win32SocketPeer. |
|
|
Implemented in VCF::Win32SocketPeer. |
|
|
Indicates whether the current operation would block. Assumes a non blocking socket. This is roughly equivalent to getting a an EWOULDBLOCK or WSAEWOULDBLOCK error number.
Implemented in VCF::Win32SocketPeer. |
The documentation for this class was generated from the following file:
- vcf/NetworkKit/Socket.h
