mn_basic_raw_ip_socket.hpp
Go to the documentation of this file.
89 int send_bytes(const void* buffer, int offset, int size, socket_flags socketFlags = socket_flags::none); //
101 int send_to(char* buffer, int size, endpoint_type& ep, const socket_flags& socketFlags = socket_flags::none)
115 int send_to(char* buffer, int offset, int size, const socket_flags& socketFlags, endpoint_type& ep); //
137 int recive_from(char* buffer, int size, endpoint_type* ep, const socket_flags& socketFlags = socket_flags::none)
149 int recive_from(char* buffer, int offset, int size, const socket_flags& socketFlags, endpoint_type* ep); //
245 int send_bytes(const void* buffer, int offset, int size, socket_flags socketFlags = socket_flags::none); //
257 int send_to(char* buffer, int size, endpoint_type& ep, const socket_flags& socketFlags = socket_flags::none);
270 int send_to(char* buffer, int offset, int size, const socket_flags& socketFlags, endpoint_type& ep); //
292 int recive_from(char* buffer, int size, endpoint_type* ep, const socket_flags& socketFlags = socket_flags::none); //
303 int recive_from(char* buffer, int offset, int size, const socket_flags& socketFlags, endpoint_type* ep); //
A buffer class that allocates a buffer of a given type and size.
Definition: mn_buffer.hpp:37
This class represents an internet (IP) version 6 host address.
Definition: mn_basic_ip4_address.hpp:38
Definition: mn_basic_ip4_endpoint.hpp:36
This class represents an internet (IP) version 4 host socket.
Definition: mn_basic_ip4_socket.hpp:31
basic_ip4_socket(handle_type &hndl, endpoint_type *endp=nullptr) noexcept
Construct the wrapper class from a given lwip socket handle and the endpoint.
Definition: mn_basic_ip4_socket.cpp:27
basic_ip4_endpoint endpoint_type
Definition: mn_basic_ip4_socket.hpp:34
basic_ip4_address ipaddress_type
Definition: mn_basic_ip4_socket.hpp:35
typename basic_ip_socket::handle_type handle_type
Definition: mn_basic_ip4_socket.hpp:33
This class represents an internet (IP) version 6 host address.
Definition: mn_basic_ip6_address.hpp:49
This class represents an IPv6 endpoint/socket address.
Definition: mn_basic_ip6_endpoint.hpp:41
This class represents an internet (IP) version 6 host socket.
Definition: mn_basic_ip6_socket.hpp:33
basic_ip6_socket(handle_type &hndl, basic_ip6_endpoint *endp=nullptr) noexcept
Construct the wrapper class from a given lwip socket handle and the endpoint.
Definition: mn_basic_ip6_socket.cpp:29
basic_ip6_address ipaddress_type
Definition: mn_basic_ip6_socket.hpp:37
basic_ip6_endpoint endpoint_type
Definition: mn_basic_ip6_socket.hpp:36
typename basic_ip_socket::handle_type handle_type
Definition: mn_basic_ip6_socket.hpp:35
Wrapper class around lwip implementation of a socket.
Definition: mn_basic_socket.hpp:54
int set_options(const socket_option_level &opt, const socket_option_name &name, int value)
Sets the socket option specified by level and option to the given integer value.
Definition: mn_basic_socket.cpp:126
bool get_option_bool(const socket_option_level &opt, const socket_option_name &name)
Get a booles value of a given option.
Definition: mn_basic_socket.cpp:167
This class provides an interface to a raw IPv4 socket.
Definition: mn_basic_raw_ip_socket.hpp:33
basic_raw_ip4_socket self_type
Definition: mn_basic_raw_ip_socket.hpp:35
int recive_from(char *buffer, int size, endpoint_type *ep, const socket_flags &socketFlags=socket_flags::none)
recive a buffer of data
Definition: mn_basic_raw_ip_socket.hpp:137
basic_raw_ip4_socket & operator=(const basic_raw_ip4_socket &other)
Definition: mn_basic_raw_ip_socket.cpp:41
basic_raw_ip4_socket(handle_type &hndl, endpoint_type *endp=nullptr)
Definition: mn_basic_raw_ip_socket.hpp:176
int recive(char *buffer, int size, socket_flags socketFlags=socket_flags::none)
Receives data from the socket and stores it in buffer. Up to length bytes are received.
Definition: mn_basic_raw_ip_socket.cpp:195
typename base_type::endpoint_type endpoint_type
Definition: mn_basic_raw_ip_socket.hpp:38
bool listen(int backLog=8)
Puts the socket into listening state.
Definition: mn_basic_raw_ip_socket.cpp:92
basic_raw_ip4_socket(const protocol_type &protocol)
Definition: mn_basic_raw_ip_socket.hpp:178
virtual basic_ip_socket * get_copy()
Get a copy of this socket.
Definition: mn_basic_raw_ip_socket.hpp:157
void set_broadcast(bool flag)
Sets the value of the SO_BROADCAST socket option.
Definition: mn_basic_raw_ip_socket.hpp:164
bool connect(endpoint_type remote_ep)
Establishes a connection to the stream server at the given address.
Definition: mn_basic_raw_ip_socket.cpp:50
int send_bytes(const void *buffer, int size, socket_flags socketFlags=socket_flags::none)
Sends the contents of the given buffer.
Definition: mn_basic_raw_ip_socket.cpp:126
bool get_broadcast()
Gets the value of the SO_BROADCAST socket option.
Definition: mn_basic_raw_ip_socket.hpp:172
basic_raw_ip4_socket()
Definition: mn_basic_raw_ip_socket.cpp:29
self_type * accept()
Gets the next completed connection from the socket's completed connection queue.
Definition: mn_basic_raw_ip_socket.cpp:71
int send_to(char *buffer, int size, endpoint_type &ep, const socket_flags &socketFlags=socket_flags::none)
send a buffer of data to the given enpoint
Definition: mn_basic_raw_ip_socket.hpp:101
This class provides an interface to a raw IPv6 socket.
Definition: mn_basic_raw_ip_socket.hpp:189
void set_broadcast(bool flag)
Sets the value of the SO_BROADCAST socket option.
Definition: mn_basic_raw_ip_socket.hpp:318
basic_raw_ip6_socket(handle_type &hndl, endpoint_type *endp=nullptr)
Definition: mn_basic_raw_ip_socket.hpp:330
bool connect(endpoint_type remote_ep)
Establishes a connection to the stream server at the given address.
Definition: mn_basic_raw_ip_socket.cpp:264
basic_raw_ip6_socket & operator=(const basic_raw_ip6_socket &other)
Definition: mn_basic_raw_ip_socket.cpp:215
basic_raw_ip6_socket self_type
Definition: mn_basic_raw_ip_socket.hpp:191
virtual basic_ip_socket * get_copy()
Get a copy of this socket.
Definition: mn_basic_raw_ip_socket.hpp:311
self_type * accept()
Gets the next completed connection from the socket's completed connection queue.
Definition: mn_basic_raw_ip_socket.cpp:296
bool listen(int backLog=8)
Puts the socket into listening state.
Definition: mn_basic_raw_ip_socket.cpp:288
basic_raw_ip6_socket()
Definition: mn_basic_raw_ip_socket.cpp:203
int recive(char *buffer, int size, socket_flags socketFlags=socket_flags::none)
Receives data from the socket and stores it in buffer. Up to length bytes are received.
int send_to(char *buffer, int size, endpoint_type &ep, const socket_flags &socketFlags=socket_flags::none)
send a buffer of data to the given enpoint
Definition: mn_basic_raw_ip_socket.cpp:387
bool get_broadcast()
Gets the value of the SO_BROADCAST socket option.
Definition: mn_basic_raw_ip_socket.hpp:326
int recive_from(char *buffer, int size, endpoint_type *ep, const socket_flags &socketFlags=socket_flags::none)
recive a buffer of data
Definition: mn_basic_raw_ip_socket.cpp:353
int send_bytes(const void *buffer, int size, socket_flags socketFlags=socket_flags::none)
Sends the contents of the given buffer.
Definition: mn_basic_raw_ip_socket.cpp:249
basic_raw_ip6_socket(const protocol_type &protocol)
Definition: mn_basic_raw_ip_socket.hpp:332
protocol_type
Defines socket protoco types for creating.
Definition: mn_net_types.hpp:60
socket_type
Defines socket socket types for creating.
Definition: mn_net_types.hpp:99
socket_flags
Specifies socket send and receive behaviors.
Definition: mn_net_types.hpp:118
Definition: mn_allocator_typetraits.hpp:25