Free Electron
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
fe::ext::SockAddr Class Reference

BSD socket address wrapper. More...

#include <Socket.h>

Public Member Functions

struct sockaddr * ptr (void)
 Access pointer to underlying (struct sockaddr *) More...
 
int size (void)
 Return size of address. More...
 
void setPort (FE_UWORD port)
 Set the port. More...
 
void setAddress (const U32 address)
 Set the address. More...
 
void setAddress (const String &host)
 Set the address. More...
 
String hostname (void)
 Return the hostname for the address. More...
 
FE_UWORD port (void)
 

Static Public Member Functions

static U32 getIp4Address (const String &host)
 Return the address. More...
 

Protected Attributes

struct sockaddr_in m_sockaddr
 

Detailed Description

BSD socket address wrapper.

Member Function Documentation

◆ getIp4Address()

U32 fe::ext::SockAddr::getIp4Address ( const String host)
static

Return the address.

References fe::String::c_str(), and fe::String::empty().

◆ hostname()

String fe::ext::SockAddr::hostname ( void  )

Return the hostname for the address.

◆ ptr()

struct sockaddr* fe::ext::SockAddr::ptr ( void  )
inline

Access pointer to underlying (struct sockaddr *)

◆ setAddress() [1/2]

void fe::ext::SockAddr::setAddress ( const U32  address)
inline

Set the address.

◆ setAddress() [2/2]

void fe::ext::SockAddr::setAddress ( const String host)

Set the address.

This may either be the hostname or the dot notation address.

◆ setPort()

void fe::ext::SockAddr::setPort ( FE_UWORD  port)
inline

Set the port.

Todo:
add a by-service-name port set.

Referenced by fe::ext::BSDServer::start().

◆ size()

int fe::ext::SockAddr::size ( void  )
inline

Return size of address.

Referenced by fe::ext::Socket::accept().


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