int match_endpoints(endp p1, endp p2, endp amatch) { /* Should this be type_equal ? unclear (only real diff, given that we will forbid old style parameter lists, is transparent union handling) */ if (type_compatible(endpoint_type(p1), endpoint_type(p2))) { if (amatch) *amatch = *p2; return 1; } else return 0; }
void start(boost::system::error_code& ec) { if(!is_started()) init_socket(ec); if(ec) return; static const endpoint_type multicast_endpoint = endpoint_type(address_type::from_string("239.255.255.250"), 1900); _socket.send_to(boost::asio::buffer(discovery_msg, sizeof(discovery_msg)), multicast_endpoint, 0, ec); }
// Move-assign from another socket implementation. void move_assign(implementation_type& impl, winrt_ssocket_service& other_service, implementation_type& other_impl) { this->base_move_assign(impl, other_service, other_impl); impl.protocol_ = other_impl.protocol_; other_impl.protocol_ = endpoint_type().protocol(); }
// Default constructor. implementation_type() : protocol_(endpoint_type().protocol()) { }
/// Get the local endpoint. endpoint_type local_endpoint(const implementation_type& impl, boost::system::error_code& ec) const { return endpoint_type(*(impl->p_fib_demux), impl->id.local_port()); }
void operator=(socket_type s) { socket_ = s; have_remote_endpoint_ = false; remote_endpoint_ = endpoint_type(); }
// Default constructor. implementation_type() : protocol_(endpoint_type().protocol()), have_remote_endpoint_(false), remote_endpoint_() { }