Faspstream Manager C/C++ API  3.6.1
A C and C++ language interface to basic streaming over the fasp protocol
FaspConnectionChannel Class Referenceabstract

#include <FaspConnectionChannel.h>

Inheritance diagram for FaspConnectionChannel:
FaspSocketChannel

Public Member Functions

virtual int read (char *buff, size_t bytes)=0
 
virtual int write (const char *data, size_t bytes)=0
 
virtual void close ()=0
 

Detailed Description

Abstract interface that internal code will use to share your TCP connection and tunnel fasp control data.

Member Function Documentation

virtual void FaspConnectionChannel::close ( )
pure virtual

Internal code calls this when it is finished sharing the TCP connection. You do not need to close the TCP connection you are sharing, but this gives you an opportunity to do so if you wish.

Implemented in FaspSocketChannel.

virtual int FaspConnectionChannel::read ( char *  buff,
size_t  bytes 
)
pure virtual

Should return number of bytes read from TCP socket.

IMPORTANT: Your implementation should be non-blocking / timeout. For example, you can configure the TCP socket to timeout after trying to read for so many milliseconds. If you don't set a timeout or make this non-blocking, internal code will hang trying to read.

Return zero for end of file, negative for error.

Throw a FaspChannelTimeoutException if a timeout occurred / there is nothing to read.

Throw a FaspChannelClosedException if the TCP socket (unexpectedly) closed.

Implemented in FaspSocketChannel.

virtual int FaspConnectionChannel::write ( const char *  data,
size_t  bytes 
)
pure virtual

Should return number of bytes written.

write does not need to be non-blocking / have a timeout. It can, however, and internal code will continue to retry writing.

Return negative on error.

Throw FaspChannelClosedException if the TCP socket (unexpectedly) closed.

Implemented in FaspSocketChannel.


The documentation for this class was generated from the following file: