BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
udp_socket.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <memory>
3 
4 namespace fc {
5  namespace ip {
6  class endpoint;
7  class address;
8  }
9 
14  class udp_socket {
15  public:
16  udp_socket();
17  udp_socket( const udp_socket& s );
18  ~udp_socket();
19 
20  void open();
21  void set_receive_buffer_size( size_t s );
22  void bind( const fc::ip::endpoint& );
23  size_t receive_from( char* b, size_t l, fc::ip::endpoint& from );
24  size_t receive_from( const std::shared_ptr<char>& b, size_t l, fc::ip::endpoint& from );
25  size_t send_to( const char* b, size_t l, const fc::ip::endpoint& to );
26  size_t send_to( const std::shared_ptr<const char>& b, size_t l, const fc::ip::endpoint& to );
27  void close();
28 
29  void set_multicast_enable_loopback( bool );
30  void set_reuse_address( bool );
31  void join_multicast_group( const fc::ip::address& a );
32 
33  void connect( const fc::ip::endpoint& e );
35 
36  private:
37  class impl;
38  std::shared_ptr<impl> my;
39  };
40 
41 }
fc::udp_socket::impl
Definition: udp_socket.cpp:9
fc::udp_socket
Definition: udp_socket.hpp:14
fc::udp_socket::join_multicast_group
void join_multicast_group(const fc::ip::address &a)
Definition: udp_socket.cpp:168
fc
Definition: api.hpp:15
fc::ip::address
Definition: ip.hpp:10
fc::udp_socket::receive_from
size_t receive_from(char *b, size_t l, fc::ip::endpoint &from)
Definition: udp_socket.cpp:123
fc::udp_socket::~udp_socket
~udp_socket()
Definition: udp_socket.cpp:36
fc::asio::tcp::endpoint
boost::asio::ip::tcp::endpoint endpoint
Definition: asio.hpp:239
fc::ip::endpoint
Definition: ip.hpp:65
fc::udp_socket::local_endpoint
fc::ip::endpoint local_endpoint() const
Definition: udp_socket.cpp:153
fc::udp_socket::bind
void bind(const fc::ip::endpoint &)
Definition: udp_socket.cpp:93
fc::udp_socket::connect
void connect(const fc::ip::endpoint &e)
Definition: udp_socket.cpp:156
fc::udp_socket::set_reuse_address
void set_reuse_address(bool)
Definition: udp_socket.cpp:164
fc::udp_socket::set_multicast_enable_loopback
void set_multicast_enable_loopback(bool)
Definition: udp_socket.cpp:160
fc::udp_socket::open
void open()
Definition: udp_socket.cpp:86
fc::udp_socket::close
void close()
Definition: udp_socket.cpp:148
fc::udp_socket::send_to
size_t send_to(const char *b, size_t l, const fc::ip::endpoint &to)
Definition: udp_socket.cpp:47
fc::udp_socket::set_receive_buffer_size
void set_receive_buffer_size(size_t s)
Definition: udp_socket.cpp:90
fc::udp_socket::udp_socket
udp_socket()
Definition: udp_socket.cpp:26