libfilezilla
Public Member Functions | List of all members
socket_descriptor Class Referencefinal

Lightweight holder for socket descriptors. More...

#include <socket.hpp>

Public Member Functions

 socket_descriptor (socket_base::socket_t fd) noexcept
 
 socket_descriptor (socket_descriptor const &)=delete
 
socket_descriptoroperator= (socket_descriptor const &)=delete
 
 socket_descriptor (socket_descriptor &&rhs) noexcept
 
socket_descriptoroperator= (socket_descriptor &&rhs) noexcept
 
socket_base::socket_t detach ()
 
 operator bool () const
 
std::string peer_ip (bool strip_zone_index=false) const
 Returns remote address of a connected socket. More...
 
int peer_port (int &error) const
 Returns remote port of a connected socket. More...
 

Detailed Description

Lightweight holder for socket descriptors.

Member Function Documentation

◆ peer_ip()

std::string peer_ip ( bool  strip_zone_index = false) const

Returns remote address of a connected socket.

Returns
empty string on error

◆ peer_port()

int peer_port ( int &  error) const

Returns remote port of a connected socket.

Returns
-1 on error

The documentation for this class was generated from the following file: