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

VCF::UDPSocketOutputStream Class Reference

#include <vcf/NetworkKit/Socket.h>

Inheritance diagram for VCF::UDPSocketOutputStream:

VCF::OutputStream VCF::Stream List of all members.

Public Member Functions

 UDPSocketOutputStream (UDPSocket &socket, const IPEndPoint &sendTo)
virtual void seek (const uint64 &offset, const SeekType &offsetFrom)
 Seeking is not permitted!
virtual uint64 getSize ()
 returns the size of the stream.
virtual uchargetBuffer ()
 Returns NULL - this is not permitted.
virtual uint64 getCurrentSeekPos ()
 this is a global offset from the beggining of the stream
virtual uint64 write (const unsigned char *bytesToWrite, uint64 sizeOfBytes)
 Attempts to write sizeOfBytes to the socket associated with this stream.
uint64 writeTo (const unsigned char *bytesToWrite, uint64 sizeOfBytes, const IPEndPoint &to)

Protected Attributes

uint64 totalBytesWritten_
Socketsocket_
IPEndPoint sendTo_

Constructor & Destructor Documentation

VCF::UDPSocketOutputStream::UDPSocketOutputStream UDPSocket socket,
const IPEndPoint sendTo
 


Member Function Documentation

virtual uchar* VCF::UDPSocketOutputStream::getBuffer  )  [inline, virtual]
 

Returns NULL - this is not permitted.

Implements VCF::Stream.

virtual uint64 VCF::UDPSocketOutputStream::getCurrentSeekPos  )  [inline, virtual]
 

this is a global offset from the beggining of the stream

Implements VCF::Stream.

virtual uint64 VCF::UDPSocketOutputStream::getSize  )  [inline, virtual]
 

returns the size of the stream.

The size represents the number of bytes that have been written, or read to/from the stream

Implements VCF::Stream.

virtual void VCF::UDPSocketOutputStream::seek const uint64 offset,
const SeekType offsetFrom
[inline, virtual]
 

Seeking is not permitted!

Implements VCF::Stream.

virtual uint64 VCF::UDPSocketOutputStream::write const unsigned char *  bytesToWrite,
uint64  sizeOfBytes
[virtual]
 

Attempts to write sizeOfBytes to the socket associated with this stream.

The method will return the number of bytes written to the socket. The return value may be the following:

  • A number greater than 0 but less than sizeOfBytes that indicates the number of bytes successfully written to the socket
  • 0 which may indicate a disconnect has happened and no bytes were written. If the socket is marked as non-blocking then the method will return 0 bytes, but the sockets Socket::wouldOperationBlock() method will return true. If the socket is a blocking socket, then this is probably an error.
  • If the socket's peer reports an error in writing to the socket, then the method will throw a NetworkException.

Implements VCF::OutputStream.

uint64 VCF::UDPSocketOutputStream::writeTo const unsigned char *  bytesToWrite,
uint64  sizeOfBytes,
const IPEndPoint to
 


Member Data Documentation

IPEndPoint VCF::UDPSocketOutputStream::sendTo_ [protected]
 

Socket* VCF::UDPSocketOutputStream::socket_ [protected]
 

uint64 VCF::UDPSocketOutputStream::totalBytesWritten_ [protected]
 


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