Re: [boost] Determine socket is ipv4 or ipv6
 
            
            
            
            
                16 May
                
                    2023
                
            
            
                16 May
                
                '23
                
            
            
            
        
    
                7:01 a.m.
            
        On 16/05/2023 15:26, Tarun Batra wrote:
I have a code something like this:
TcpConnection::pointer my_conn = GetConn(req);
tcp::socket& my_socket = my_conn->getSocket();
tcp::resolver my_resolver(my_socket.get_executor());
Is it possible to check if the my_socket is ipv4 socket or ipv6 socket?
That depends exactly what you mean by that, but you're likely looking for something like: my_socket.remote_endpoint().address().is_v6() Doxygen doesn't do a very good job at navigating the type templates involved here; using your IDE's code completion is more successful.
        899
        
      
          Age (days ago)
        
      
        899
        
    
          Last active (days ago)
        
        
        
        0 comments
    
    
        
        1 participants
    
    
    
    
    
    
    
    
    participants (1)
- 
                 Gavin Lambert Gavin Lambert