Faspstream Manager C/C++ API  3.6.1
A C and C++ language interface to basic streaming over the fasp protocol
FaspSocketChannel.h
Go to the documentation of this file.
1 /*
2  * Aspera, Inc.
3  *
4  * Internal.
5  *
6  * The C wrapper code uses this to implement the FaspConnectionChannel
7  * interface, using a socket wrapped in a fasp_stream_socket_wrapper_t.
8  */
9 #pragma once
10 
11 #include <FaspConnectionChannel.h>
12 #include <fasp_stream_channel.h>
13 
15 
16 public:
18 
19  int
20  write(const char *buff, size_t len) {
21 
22  return this->w->write(this->w, buff, len);
23 
24  }
25 
26  int
27  read(char *buff, size_t len) {
28 
29  int ret, timedout = 0;
30 
31  ret = this->w->read(this->w, buff, len, &timedout);
32  if (ret == 0 && timedout)
34 
35  return ret;
36  }
37 
38  void
39  close() {
40 
41  this->w->close(this->w);
42 
43  }
44 
45 private:
47 };
int(* write)(struct fasp_stream_socket_wrapper *w, const char *buff, int len)
Definition: fasp_stream_channel.h:62
Definition: fasp_stream_channel.h:39
Definition: FaspConnectionChannel.h:33
Definition: FaspConnectionChannel.h:77
void(* close)(struct fasp_stream_socket_wrapper *w)
Definition: fasp_stream_channel.h:68
int write(const char *buff, size_t len)
Definition: FaspSocketChannel.h:20
Definition: FaspSocketChannel.h:14
int read(char *buff, size_t len)
Definition: FaspSocketChannel.h:27
int(* read)(struct fasp_stream_socket_wrapper *w, char *buff, int len, int *timedout)
Definition: fasp_stream_channel.h:55
void close()
Definition: FaspSocketChannel.h:39
FaspSocketChannel(fasp_stream_socket_wrapper_t *w)
Definition: FaspSocketChannel.h:17