18 #include <hicn/transport/auth/verifier.h>
19 #include <hicn/transport/config.h>
20 #include <hicn/transport/core/asio_wrapper.h>
21 #include <hicn/transport/core/name.h>
22 #include <hicn/transport/core/prefix.h>
23 #include <hicn/transport/interfaces/callbacks.h>
24 #include <hicn/transport/interfaces/socket_options_default_values.h>
25 #include <hicn/transport/interfaces/socket_options_keys.h>
27 #define CONSUMER_FINISHED 0
28 #define CONSUMER_BUSY 1
29 #define CONSUMER_RUNNING 2
33 namespace implementation {
90 virtual void getReadBuffer(uint8_t **application_buffer,
91 size_t *max_length) = 0;
101 virtual void readDataAvailable(
size_t length) noexcept = 0;
119 std::unique_ptr<utils::MemBuf> &&buffer) noexcept {}
127 virtual void readError(
const std::error_code ec) noexcept = 0;
135 virtual void readSuccess(std::size_t total_size) noexcept = 0;
169 explicit ConsumerSocket(
int protocol, asio::io_service &io_service);
203 int consume(
const Name &name);
204 int asyncConsume(
const Name &name);
223 asio::io_service &getIoService();
225 int setSocketOption(
int socket_option_key, ReadCallback *socket_option_value);
227 int getSocketOption(
int socket_option_key,
228 ReadCallback **socket_option_value);
230 int setSocketOption(
int socket_option_key,
double socket_option_value);
232 int setSocketOption(
int socket_option_key, uint32_t socket_option_value);
234 int setSocketOption(
int socket_option_key,
235 std::nullptr_t socket_option_value);
237 int setSocketOption(
int socket_option_key,
bool socket_option_value);
239 int setSocketOption(
int socket_option_key,
240 ConsumerContentObjectCallback socket_option_value);
242 int setSocketOption(
int socket_option_key,
243 ConsumerInterestCallback socket_option_value);
245 int setSocketOption(
int socket_option_key,
249 int socket_option_key,
250 const std::shared_ptr<auth::Verifier> &socket_option_value);
252 int setSocketOption(
int socket_option_key,
253 const std::string &socket_option_value);
255 int setSocketOption(
int socket_option_key,
256 ConsumerTimerCallback socket_option_value);
258 int getSocketOption(
int socket_option_key,
double &socket_option_value);
260 int getSocketOption(
int socket_option_key, uint32_t &socket_option_value);
262 int getSocketOption(
int socket_option_key,
bool &socket_option_value);
264 int getSocketOption(
int socket_option_key,
Name **socket_option_value);
266 int getSocketOption(
int socket_option_key,
267 ConsumerContentObjectCallback **socket_option_value);
269 int getSocketOption(
int socket_option_key,
270 ConsumerInterestCallback **socket_option_value);
272 int getSocketOption(
int socket_option_key,
IcnObserver **socket_option_value);
274 int getSocketOption(
int socket_option_key,
275 std::shared_ptr<auth::Verifier> &socket_option_value);
277 int getSocketOption(
int socket_option_key, std::string &socket_option_value);
279 int getSocketOption(
int socket_option_key,
280 ConsumerTimerCallback **socket_option_value);
282 int getSocketOption(
int socket_option_key,
287 std::unique_ptr<implementation::ConsumerSocket> socket_;