Robotics Library  0.7.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
rl::hal::Socket Class Reference

#include <Socket.h>

Inheritance diagram for rl::hal::Socket:
Inheritance graph
[legend]

Classes

class  Address
 

Public Types

enum  Option {
  OPTION_KEEPALIVE, OPTION_MULTICAST_LOOP, OPTION_MULTICAST_TTL, OPTION_NODELAY,
  OPTION_QUICKACK
}
 

Public Member Functions

 Socket (const Socket &socket)
 
virtual ~Socket ()
 
Socket accept ()
 
void bind ()
 
void close ()
 
void connect ()
 
const AddressgetAddress () const
 
int getOption (const Option &option) const
 
const int & getProtocol () const
 
const int & getType () const
 
void listen ()
 
void listen (const int &backlog)
 
void open ()
 
::std::size_t recv (void *buf, const ::std::size_t &count)
 
::std::size_t recvfrom (void *buf, const ::std::size_t &count, Address &address)
 
::std::size_t select (const bool &read, const bool &write, const ::std::chrono::nanoseconds &timeout)
 
::std::size_t send (const void *buf, const ::std::size_t &count)
 
::std::size_t sendto (const void *buf, const ::std::size_t &count, const Address &address)
 
void setAddress (const Address &address)
 
void setOption (const Option &option, const int &value)
 
void shutdown (const bool &read=true, const bool &write=true)
 
- Public Member Functions inherited from rl::hal::Com
 Com ()
 
virtual ~Com ()
 
bool isConnected () const
 

Static Public Member Functions

static Socket Tcp (const Address &address)
 
static Socket Udp (const Address &address)
 

Protected Member Functions

 Socket (const int &type, const int &protocol, const Address &address)
 
 Socket (const int &type, const int &protocol, const Address &address, const int &fd)
 
- Protected Member Functions inherited from rl::hal::Com
void setConnected (const bool &connected)
 

Protected Attributes

int fd
 

Private Attributes

Address address
 
int protocol
 
int type
 

Member Enumeration Documentation

◆ Option

Enumerator
OPTION_KEEPALIVE 
OPTION_MULTICAST_LOOP 
OPTION_MULTICAST_TTL 
OPTION_NODELAY 
OPTION_QUICKACK 

Constructor & Destructor Documentation

◆ Socket() [1/3]

rl::hal::Socket::Socket ( const Socket socket)

◆ ~Socket()

rl::hal::Socket::~Socket ( )
virtual

◆ Socket() [2/3]

rl::hal::Socket::Socket ( const int &  type,
const int &  protocol,
const Address address 
)
protected

◆ Socket() [3/3]

rl::hal::Socket::Socket ( const int &  type,
const int &  protocol,
const Address address,
const int &  fd 
)
protected

Member Function Documentation

◆ accept()

Socket rl::hal::Socket::accept ( )

◆ bind()

void rl::hal::Socket::bind ( )

◆ close()

void rl::hal::Socket::close ( )
virtual

Implements rl::hal::Com.

◆ connect()

void rl::hal::Socket::connect ( )

◆ getAddress()

const Socket::Address & rl::hal::Socket::getAddress ( ) const

◆ getOption()

int rl::hal::Socket::getOption ( const Option option) const

◆ getProtocol()

const int & rl::hal::Socket::getProtocol ( ) const

◆ getType()

const int & rl::hal::Socket::getType ( ) const

◆ listen() [1/2]

void rl::hal::Socket::listen ( )

◆ listen() [2/2]

void rl::hal::Socket::listen ( const int &  backlog)

◆ open()

void rl::hal::Socket::open ( )
virtual

Implements rl::hal::Com.

◆ recv()

std::size_t rl::hal::Socket::recv ( void *  buf,
const ::std::size_t &  count 
)

◆ recvfrom()

std::size_t rl::hal::Socket::recvfrom ( void *  buf,
const ::std::size_t &  count,
Address address 
)

◆ select()

std::size_t rl::hal::Socket::select ( const bool &  read,
const bool &  write,
const ::std::chrono::nanoseconds &  timeout 
)

◆ send()

std::size_t rl::hal::Socket::send ( const void *  buf,
const ::std::size_t &  count 
)

◆ sendto()

std::size_t rl::hal::Socket::sendto ( const void *  buf,
const ::std::size_t &  count,
const Address address 
)

◆ setAddress()

void rl::hal::Socket::setAddress ( const Address address)

◆ setOption()

void rl::hal::Socket::setOption ( const Option option,
const int &  value 
)

◆ shutdown()

void rl::hal::Socket::shutdown ( const bool &  read = true,
const bool &  write = true 
)

◆ Tcp()

Socket rl::hal::Socket::Tcp ( const Address address)
static

◆ Udp()

Socket rl::hal::Socket::Udp ( const Address address)
static

Member Data Documentation

◆ address

Address rl::hal::Socket::address
private

◆ fd

int rl::hal::Socket::fd
protected

◆ protocol

int rl::hal::Socket::protocol
private

◆ type

int rl::hal::Socket::type
private

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