26 #ifndef ODVA_ETHERNETIP_SOCKET_SOCKET_H
27 #define ODVA_ETHERNETIP_SOCKET_SOCKET_H
30 #include <boost/asio.hpp>
32 #if BOOST_VERSION >= 107000
33 #define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s)->get_executor().context())
35 #define GET_IO_SERVICE(s) ((s)->get_io_service())
43 using boost::asio::buffer;
44 using boost::asio::const_buffer;
45 using boost::asio::mutable_buffer;
49 using serialization::Serializable;
50 using serialization::BufferWriter;
69 virtual void open(
string hostname,
string port) = 0;
74 virtual void close() = 0;
81 virtual size_t send(const_buffer buf) = 0;
93 return send(buffer(buf));
101 virtual size_t receive(mutable_buffer buf) = 0;
107 #endif // ODVA_ETHERNETIP_SOCKET_SOCKET_H