#include <Host.h>
◆ Host() [1/7]
◆ Host() [2/7]
      
        
          | sptk::Host::Host  | 
          ( | 
          const String &  | 
          hostname,  | 
        
        
           | 
           | 
          uint16_t  | 
          port  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Constructor 
- Parameters
 - 
  
    | hostname | Host name or IP address  | 
    | port | Port number  | 
  
   
 
 
◆ Host() [3/7]
  
  
      
        
          | sptk::Host::Host  | 
          ( | 
          const String &  | 
          hostAndPort | ) | 
           | 
         
       
   | 
  
explicit   | 
  
 
Constructor In order to work with IPv6 address, enclose address part in square brackets. 
- Parameters
 - 
  
    | hostAndPort | The host and port definition, in the format ipv4addr:port.  | 
  
   
 
 
◆ Host() [4/7]
  
  
      
        
          | sptk::Host::Host  | 
          ( | 
          const sockaddr_in *  | 
          addressAndPort | ) | 
           | 
         
       
   | 
  
explicit   | 
  
 
Constructor 
- Parameters
 - 
  
    | addressAndPort | The host and port, IPv4  | 
  
   
 
 
◆ Host() [5/7]
  
  
      
        
          | sptk::Host::Host  | 
          ( | 
          const sockaddr_in6 *  | 
          addressAndPort | ) | 
           | 
         
       
   | 
  
explicit   | 
  
 
Constructor 
- Parameters
 - 
  
    | addressAndPort | The host and port, IPv6  | 
  
   
 
 
◆ Host() [6/7]
      
        
          | sptk::Host::Host  | 
          ( | 
          const Host &  | 
          other | ) | 
           | 
        
      
 
Copy constructor 
- Parameters
 - 
  
  
 
 
 
◆ Host() [7/7]
  
  
      
        
          | sptk::Host::Host  | 
          ( | 
          Host &&  | 
          other | ) | 
           | 
         
       
   | 
  
noexcept   | 
  
 
Move constructor 
- Parameters
 - 
  
  
 
 
 
◆ ~Host()
  
  
      
        
          | virtual sptk::Host::~Host  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
virtualdefault   | 
  
 
 
◆ getAddress() [1/2]
  
  
      
        
          | void sptk::Host::getAddress  | 
          ( | 
          sockaddr_in &  | 
          address | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ getAddress() [2/2]
  
  
      
        
          | void sptk::Host::getAddress  | 
          ( | 
          sockaddr_in6 &  | 
          address | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ hostname()
  
  
      
        
          | const String & sptk::Host::hostname  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get host name 
- Returns
 - host name 
 
 
 
◆ operator!=()
      
        
          | bool sptk::Host::operator!=  | 
          ( | 
          const Host &  | 
          other | ) | 
           const | 
        
      
 
Compare to another host 
- Parameters
 - 
  
  
 
- Returns
 - true if objects have not equal data 
 
 
 
◆ operator=() [1/2]
      
        
          | Host & sptk::Host::operator=  | 
          ( | 
          const Host &  | 
          other | ) | 
           | 
        
      
 
Assign from another host 
- Parameters
 - 
  
  
 
 
 
◆ operator=() [2/2]
  
  
      
        
          | Host & sptk::Host::operator=  | 
          ( | 
          Host &&  | 
          other | ) | 
           | 
         
       
   | 
  
noexcept   | 
  
 
Move assignment from another host 
- Parameters
 - 
  
  
 
 
 
◆ operator==()
      
        
          | bool sptk::Host::operator==  | 
          ( | 
          const Host &  | 
          other | ) | 
           const | 
        
      
 
Compare to another host 
- Parameters
 - 
  
  
 
- Returns
 - true if objects have equal data 
 
 
 
◆ port() [1/2]
  
  
      
        
          | uint16_t sptk::Host::port  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get port number 
- Returns
 - port number 
 
 
 
◆ port() [2/2]
  
  
      
        
          | void sptk::Host::port  | 
          ( | 
          uint16_t  | 
          p | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Set port number 
- Parameters
 - 
  
  
 
 
 
◆ toString()
      
        
          | String sptk::Host::toString  | 
          ( | 
          bool  | 
          forceAddress = false | ) | 
           const | 
        
      
 
Get host name and port as a string. IPv6 addresses are enclosed in square brackets. 
- Parameters
 - 
  
    | forceAddress | If true then use IP address instead of hostname  | 
  
   
- Returns
 - host name and port string 
 
Referenced by sptk::HostCompare::operator()().
 
 
The documentation for this class was generated from the following file: