25 #ifndef _ED247_COMINTERFACE_H_ 26 #define _ED247_COMINTERFACE_H_ 27 #include "ed247_xml.h" 28 #include "ed247_friend_test.h" 33 # include <sys/socket.h> 34 # include <netinet/in.h> 35 # include <sys/select.h> 36 using ed247_socket_t = int;
37 # define INVALID_SOCKET (-1) 39 # include <winsock2.h> 40 using ed247_socket_t = SOCKET;
52 void set_ip_address(std::string ip_address);
53 void set_ip_port(uint16_t ip_port);
54 bool is_multicast()
const;
55 bool is_unicast()
const;
56 bool is_any_addr()
const;
83 const ed247_socket_t& get_socket()
const {
return _socket; }
88 ed247_socket_t _socket{INVALID_SOCKET};
95 void send_frame(
const void* payload,
const uint32_t payload_size);
104 static const uint32_t MAX_FRAME_SIZE{65508};
107 char payload[MAX_FRAME_SIZE];
108 uint32_t size{MAX_FRAME_SIZE};
111 using receive_callback_t = std::function<void(const char* payload, uint32_t size)>;
116 receive_callback_t callback);
120 receive_callback_t _receive_callback;
153 std::vector<std::unique_ptr<Receiver>> _receivers;
156 struct select_options_s {
179 Receiver::receive_callback_t receive_callback);
182 void send_frame(
const void* payload,
const uint32_t payload_size);
189 std::vector<std::unique_ptr<Emitter>> _emitters;
194 void assert_sockets_closed();
Definition: ed247_cominterface.h:131
Definition: ed247_cominterface.h:75
Definition: ed247_cominterface.h:101
Definition: ed247_xml.h:63
Definition: ed247_cominterface.h:105
Definition: ed247_cominterface.h:91
Definition: ed247_context.h:36
Definition: ed247_cominterface.h:49
ed247_status_t
Status codes.
Definition: ed247.h:67
Definition: ed247_channel.cpp:37
Definition: ed247_cominterface.h:171