|
Robotics Library
0.7.0
|
Go to the documentation of this file.
27 #ifndef RL_HAL_SOCKET_H
28 #define RL_HAL_SOCKET_H
33 #include <sys/socket.h>
61 static Address Ipv4(const ::std::string&
string,
const unsigned short int& port,
const bool& asNumeric =
false);
63 static Address Ipv4(const ::std::string&
string, const ::std::string& port,
const bool& asNumeric =
false);
65 static Address Ipv6(const ::std::string&
string,
const unsigned short int& port,
const bool& asNumeric =
false);
67 static Address Ipv6(const ::std::string&
string, const ::std::string& port,
const bool& asNumeric =
false);
69 const ::sockaddr_storage&
get()
const;
73 ::std::string
getNameInfo(
const bool& asNumeric =
false)
const;
75 void setInfo(const ::std::string&
string,
const unsigned short int& port,
const bool& asNumeric =
false);
77 void setInfo(const ::std::string&
string, const ::std::string& port,
const bool& asNumeric =
false);
91 #if defined(__APPLE__) || defined(__QNX__) || defined(WIN32)
93 #else // __APPLE__ || __QNX__ || WIN32
96 #endif // __APPLE__ || __QNX__ || WIN32
125 void listen(
const int& backlog);
129 ::std::size_t
recv(
void* buf, const ::std::size_t& count);
131 ::std::size_t
recvfrom(
void* buf, const ::std::size_t& count, Address&
address);
133 ::std::size_t
select(
const bool& read,
const bool& write, const ::std::chrono::nanoseconds& timeout);
135 ::std::size_t
send(
const void* buf, const ::std::size_t& count);
137 ::std::size_t
sendto(
const void* buf, const ::std::size_t& count,
const Address&
address);
143 void shutdown(
const bool& read =
true,
const bool& write =
true);
162 static void cleanup();
164 static void startup();
176 #endif // RL_HAL_SOCKET_H
static Address Ipv6(const ::std::string &string, const unsigned short int &port, const bool &asNumeric=false)
Definition: Socket.cpp:709
const Address & getAddress() const
Definition: Socket.cpp:221
Option
Definition: Socket.h:87
void setOption(const Option &option, const int &value)
Definition: Socket.cpp:511
int type
Definition: Socket.h:171
::std::size_t sendto(const void *buf, const ::std::size_t &count, const Address &address)
Definition: Socket.cpp:481
const int & getType() const
Definition: Socket.cpp:310
void close()
Definition: Socket.cpp:181
const ::sockaddr_storage & get() const
Definition: Socket.cpp:725
::std::size_t recvfrom(void *buf, const ::std::size_t &count, Address &address)
Definition: Socket.cpp:386
::std::vector< unsigned char > getHexadecimal()
Definition: Socket.cpp:731
static Socket Tcp(const Address &address)
Definition: Socket.cpp:113
::std::size_t recv(void *buf, const ::std::size_t &count)
Definition: Socket.cpp:360
int fd
Definition: Socket.h:157
static Address Ipv4(const ::std::string &string, const unsigned short int &port, const bool &asNumeric=false)
Definition: Socket.cpp:693
Address address
Definition: Socket.h:167
@ OPTION_MULTICAST_TTL
Definition: Socket.h:90
void listen()
Definition: Socket.cpp:316
virtual ~Socket()
Definition: Socket.cpp:100
void open()
Definition: Socket.cpp:340
int getOption(const Option &option) const
Definition: Socket.cpp:227
void setAddress(const Address &address)
Definition: Socket.cpp:505
virtual ~Address()
Definition: Socket.cpp:685
Socket(const Socket &socket)
Definition: Socket.cpp:55
@ OPTION_KEEPALIVE
Definition: Socket.h:88
void setInfo(const ::std::string &string, const unsigned short int &port, const bool &asNumeric=false)
Definition: Socket.cpp:768
::sockaddr_storage addr
Definition: Socket.h:83
void shutdown(const bool &read=true, const bool &write=true)
Definition: Socket.cpp:580
@ OPTION_MULTICAST_LOOP
Definition: Socket.h:89
static Socket Udp(const Address &address)
Definition: Socket.cpp:119
@ OPTION_NODELAY
Definition: Socket.h:94
void connect()
Definition: Socket.cpp:203
Address()
Definition: Socket.cpp:651
::std::size_t send(const void *buf, const ::std::size_t &count)
Definition: Socket.cpp:457
void bind()
Definition: Socket.cpp:152
const int & getProtocol() const
Definition: Socket.cpp:304
@ OPTION_QUICKACK
Definition: Socket.h:95
int protocol
Definition: Socket.h:169
Socket accept()
Definition: Socket.cpp:125
::std::string getNameInfo(const bool &asNumeric=false) const
Definition: Socket.cpp:753
::std::size_t select(const bool &read, const bool &write, const ::std::chrono::nanoseconds &timeout)
Definition: Socket.cpp:417
Robotics Library.
Definition: AnalogInput.cpp:30