Faspstream Manager C/C++ API  3.6.1
A C and C++ language interface to basic streaming over the fasp protocol
fasp_stream_socket_wrapper Struct Reference

#include <fasp_stream_channel.h>

Public Attributes

void * priv
 
int(* read )(struct fasp_stream_socket_wrapper *w, char *buff, int len, int *timedout)
 
int(* write )(struct fasp_stream_socket_wrapper *w, const char *buff, int len)
 
void(* close )(struct fasp_stream_socket_wrapper *w)
 

Detailed Description

This is used to abstract socket differences between Unix, Windows, and other platforms.

IMPORTANT: Ensure the socket you use is set up for timeout with FASPSTREAM_CHANNEL_TIMEOUT as the timeout (defined in fasp_stream_constants.h).

Member Data Documentation

void(* fasp_stream_socket_wrapper::close) (struct fasp_stream_socket_wrapper *w)

This is invoked when fasp stream is finished sharing the TCP connection.

void* fasp_stream_socket_wrapper::priv

Private data/context your code will need in order to process read/write. For example, on Linux, private should point to the socket file descriptor, or to an as_feed_t.

int(* fasp_stream_socket_wrapper::read) (struct fasp_stream_socket_wrapper *w, char *buff, int len, int *timedout)

This is invoked when the feed should read data from the socket.

Return number of bytes read.

Return zero for EOF or time out. For time out, set timedout to non-zero.

Return negative on error.

int(* fasp_stream_socket_wrapper::write) (struct fasp_stream_socket_wrapper *w, const char *buff, int len)

This is invoked when the feed should write data to the socket.

Return number of bytes written, negative on error.


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