Faspstream Manager C/C++ API
3.6.1
A C and C++ language interface to basic streaming over the fasp protocol
|
#include <FaspConnectionChannel.h>
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 |
Abstract interface that internal code will use to share your TCP connection and tunnel fasp control data.
|
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.
|
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.
|
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.