Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::Win32UDPSocketPeer Class Reference

#include <Win32SocketPeer.h>

Inheritance diagram for VCF::Win32UDPSocketPeer:

VCF::Win32SocketPeer VCF::SocketPeer List of all members.

Public Member Functions

 Win32UDPSocketPeer ()
 Win32UDPSocketPeer (SOCKET handle)
virtual int create ()
virtual int connect (const String &host, const unsigned short port)
virtual int listen (unsigned short port)
virtual SocketPeeraccept ()
 Accepts a new connection and returns a new socket peer instance.
virtual int recv (unsigned char *bytes, size_t bytesLength)
virtual int send (const unsigned char *bytes, size_t bytesLength)
virtual int recvFrom (unsigned char *bytes, size_t bytesLength, IPEndPoint &fromAddr)
virtual int sendTo (const unsigned char *bytes, size_t bytesLength, const IPEndPoint &toAddr)
virtual IPAddress getRemoteHostIPAddress ()
 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 getRemotePort ()
 Returns the remote port number for this socket instance.

Constructor & Destructor Documentation

VCF::Win32UDPSocketPeer::Win32UDPSocketPeer  ) 
 

VCF::Win32UDPSocketPeer::Win32UDPSocketPeer SOCKET  handle  ) 
 


Member Function Documentation

virtual SocketPeer* VCF::Win32UDPSocketPeer::accept  )  [virtual]
 

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.

Reimplemented from VCF::Win32SocketPeer.

virtual int VCF::Win32UDPSocketPeer::connect const String host,
const unsigned short  port
[virtual]
 

Returns:
int Returns a 0 for success, otherwise a negative number to indicate an error.

Reimplemented from VCF::Win32SocketPeer.

virtual int VCF::Win32UDPSocketPeer::create  )  [virtual]
 

Creates a new OS specific socket handle. In the simplest case, this would be implemented with the BSD socket() function.
The caller specifies the socket type, which can be either a streaming type (i.e. a socket appropriate for TCP/IP streaming communication), or a datagram type (i.e. a socket appropriate for UPD communication )
Returns:
int Returns a 0 for success, otherwise a negative number to indicate an error.

Reimplemented from VCF::Win32SocketPeer.

virtual IPAddress VCF::Win32UDPSocketPeer::getRemoteHostIPAddress  )  [virtual]
 

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.

Reimplemented from VCF::Win32SocketPeer.

virtual unsigned short VCF::Win32UDPSocketPeer::getRemotePort  )  [virtual]
 

Returns the remote port number for this socket instance.

Reimplemented from VCF::Win32SocketPeer.

virtual int VCF::Win32UDPSocketPeer::listen unsigned short  port  )  [virtual]
 

Note: bind is implicitly done here.
Returns:
int Returns a 0 for success, otherwise a negative number to indicate an error.

Reimplemented from VCF::Win32SocketPeer.

virtual int VCF::Win32UDPSocketPeer::recv unsigned char *  bytes,
size_t  bytesLength
[virtual]
 

Returns:
int Returns a 0 for success, otherwise a negative number to indicate an error.

Reimplemented from VCF::Win32SocketPeer.

virtual int VCF::Win32UDPSocketPeer::recvFrom unsigned char *  bytes,
size_t  bytesLength,
IPEndPoint fromAddr
[virtual]
 

Returns:
int Returns a 0 for success, otherwise a negative number to indicate an error.

Reimplemented from VCF::Win32SocketPeer.

virtual int VCF::Win32UDPSocketPeer::send const unsigned char *  bytes,
size_t  bytesLength
[virtual]
 

Returns:
int Returns a 0 for success, otherwise a negative number to indicate an error.

Reimplemented from VCF::Win32SocketPeer.

virtual int VCF::Win32UDPSocketPeer::sendTo const unsigned char *  bytes,
size_t  bytesLength,
const IPEndPoint toAddr
[virtual]
 

Returns:
int Returns a 0 for success, otherwise a negative number to indicate an error.

Reimplemented from VCF::Win32SocketPeer.


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information