Beispiel #1
0
	void TcpConnection::getHostName(){
		if(hostName.empty()){
			ASIO::ip::address addr = socket_.remote_endpoint().address();
			hostName = addr.to_string();
			_MAKE_IP(hostName);
		}
	}
Beispiel #2
0
 static inline std::string escape_addr(const asio::ip::address& addr)
 {
     if (addr.is_v4())
     {
         return addr.to_v4().to_string();
     }
     else
     {
         return "[" + addr.to_v6().to_string() + "]";
     }
 }
Beispiel #3
0
 static inline std::string anyaddr(const asio::ip::address& addr)
 {
     if (addr.is_v4() == true)
     {
         return addr.to_v4().any().to_string();
     }
     else
     {
         return addr.to_v6().any().to_string();
     }
     gu_throw_fatal;
     throw;
 }
static void join_group(asio::ip::udp::socket& socket,
                       const asio::ip::udp::endpoint& ep,
                       const asio::ip::address& local_if)
{
    gcomm_assert(is_multicast(ep) == true);
    if (ep.address().is_v4() == true)
    {
        socket.set_option(asio::ip::multicast::join_group(ep.address().to_v4(),
                                                    local_if.to_v4()));
        socket.set_option(asio::ip::multicast::outbound_interface(local_if.to_v4()));
    }
    else
    {
        gu_throw_fatal << "mcast interface not implemented";
        socket.set_option(asio::ip::multicast::join_group(ep.address().to_v6()));
    }
}
void GstVideoServer::sendToClient( const osc::Message &m, const asio::ip::address &address )
{
    sendToClient(m,address.to_string());
}