mn_basic_socket.hpp
Go to the documentation of this file.
69 basic_ip_socket(const address_family& fam, const socket_type& type, const protocol_type& protocol) noexcept;
306 int set_options(const socket_option_level& opt, const socket_option_name& name, unsigned int value);
315 int set_options(const socket_option_level& opt, const socket_option_name& name, basic_ip4_address value);
324 int set_options(const socket_option_level& opt, const socket_option_name& name, basic_ip6_address value);
This class represents an internet (IP) version 6 host address.
Definition: mn_basic_ip4_address.hpp:38
This class represents an internet (IP) version 6 host address.
Definition: mn_basic_ip6_address.hpp:49
Wrapper class around lwip implementation of a socket.
Definition: mn_basic_socket.hpp:54
virtual int available()
Returns the number of bytes available that can be read without causing the socket to block.
Definition: mn_basic_socket.cpp:62
int ioctl(const ioctl_request_type &request, int &arg)
A wrapper for the ioctl system call.
Definition: mn_basic_socket.cpp:413
int get_last_error(bool poolLast=true)
Get the saved copy of the last lwip error code.
Definition: mn_basic_socket.cpp:119
int get_fcntl()
A wrapper for the fcntl system call.
Definition: mn_basic_socket.cpp:429
void set_recive_timeout(int value)
Set the option socket_option_name::recive_timeout.
Definition: mn_basic_socket.cpp:314
virtual bool initialized()
If the socket initialized.
Definition: mn_basic_socket.cpp:113
bool get_rause_port()
Get the value of the option socket_option_name::reuse_port.
Definition: mn_basic_socket.cpp:328
virtual void swap(basic_ip_socket &rhs) noexcept
Definition: mn_basic_socket.hpp:136
int get_recive_timeout()
Set the option socket_option_name::recive_timeout.
Definition: mn_basic_socket.cpp:397
int get_option_int(const socket_option_level &opt, const socket_option_name &name)
Get a interger value of a given option.
Definition: mn_basic_socket.cpp:154
int get_option_raw(const socket_option_level &opt, const socket_option_name &name, void *value, uint32_t size)
Get a buffer value of a given option.
Definition: mn_basic_socket.cpp:174
address_family m_eFam
A saved / cached copy of the address family type of this socket.
Definition: mn_basic_socket.hpp:416
int get_send_timeout()
Set the option socket_option_name::send_timeout.
Definition: mn_basic_socket.cpp:390
bool get_nocheak()
Get the value of the option socket_option_name::no_check.
Definition: mn_basic_socket.cpp:370
void set_send_timeout(int value)
Set the option socket_option_name::send_timeout.
Definition: mn_basic_socket.cpp:307
void set_rause_port(bool flag)
Set the option socket_option_name::reuse_port.
Definition: mn_basic_socket.cpp:241
basic_ip_socket(const handle_type &hndl) noexcept
construtor from a raw handle
Definition: mn_basic_socket.cpp:27
bool get_no_delay()
Get the value of the option socket_option_name::no_delay.
Definition: mn_basic_socket.cpp:351
void set_keep_alive(bool flag)
Set the option socket_option_name::keepalive.
Definition: mn_basic_socket.cpp:265
bool get_blocking()
Is the socket blocking enabled.
Definition: mn_basic_socket.hpp:267
bool get_keep_alive()
Get the value of the option socket_option_name::keepalive.
Definition: mn_basic_socket.cpp:357
int get_recive_buffer_size()
Get the size of the recive buffer.
Definition: mn_basic_socket.cpp:383
virtual void reset(const handle_type &hnd=MNTHREAD_NET_INVALID_SOCKET, bool bClosed=false)
Reset the socket.
Definition: mn_basic_socket.cpp:73
bool get_oob_inline()
Get the value of the option socket_option_name::oob_inline.
Definition: mn_basic_socket.cpp:363
socket_type m_eType
A saved / cached copy of the socket type of this socket.
Definition: mn_basic_socket.hpp:420
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
virtual ~basic_ip_socket() noexcept
deconstrutor, close the socket
Definition: mn_basic_socket.cpp:45
handle_type m_iHandle
Reference to the underlying socket handle for this socket.
Definition: mn_basic_socket.hpp:411
void shutdown(const socket_shutdown_type &cmd)
send shutdown
Definition: mn_basic_socket.cpp:437
void set_no_delay(bool flag)
Set the option socket_option_name::tcp_nodelay.
Definition: mn_basic_socket.cpp:259
virtual bool open()
Open the socket - only used when the socket not initialized.
Definition: mn_basic_socket.cpp:82
bool get_reuse_address()
Get the value of the option socket_option_name::reuse_addr.
Definition: mn_basic_socket.cpp:321
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
void set_send_buffer_size(int value)
Set the size of the send buffer.
Definition: mn_basic_socket.cpp:293
bool m_bBlocked
A saved / cached copy of a blocked flag.
Definition: mn_basic_socket.hpp:429
int get_send_buffer_size()
Get the size of the send buffer.
Definition: mn_basic_socket.cpp:376
bool poll(const unsigned long &timeout, int mode)
poll the socket
Definition: mn_basic_socket.cpp:443
void set_nocheak(bool value)
Set the option socket_option_name::no_check.
Definition: mn_basic_socket.cpp:286
void set_blocking(bool flag)
Set the socket for bloking.
Definition: mn_basic_socket.cpp:277
void set_reuse_address(bool flag)
Set the option socket_option_name::reuse_addr.
Definition: mn_basic_socket.cpp:234
int get_handle()
Get the raw socket handle.
Definition: mn_basic_socket.hpp:125
void get_linger(bool &on, int &seconds)
Get the value of the option socket_option_name::linger.
Definition: mn_basic_socket.cpp:338
basic_ip_socket & operator=(const basic_ip_socket &other)
Definition: mn_basic_socket.cpp:222
protocol_type m_eProtocol
A saved / cached copy of the protocal type of this socket.
Definition: mn_basic_socket.hpp:424
virtual basic_ip_socket * get_copy()=0
Get a copy of the socket wrapper (abstarct)
void set_oob_inline(bool flag)
Set the option socket_option_name::oob_inline.
Definition: mn_basic_socket.cpp:271
void set_linger(bool on, int seconds)
Set the option socket_option_name::linger.
Definition: mn_basic_socket.cpp:249
int set_fcntl(int arg)
A wrapper for the fcntl system call.
Definition: mn_basic_socket.cpp:421
void set_recive_buffer_size(int value)
Set the size of the recive buffer.
Definition: mn_basic_socket.cpp:300
struct mn::memory::detail::ptr_difference type
socket_shutdown_type
Commands for lwip_shutdown.
Definition: mn_net_types.hpp:157
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
address_family
Defines socket address types for creating.
Definition: mn_net_types.hpp:41
socket_option_name
Items for socket option name for the mn_socket::set_options and mn_socket::get_options.
Definition: mn_net_types.hpp:209
socket_option_level
Items for socket option levels for the mn_socket::set_options and mn_socket::get_options.
Definition: mn_net_types.hpp:175
ioctl_request_type
Commands for ioctlsocket(), taken from the BSD file fcntl.h. lwip_ioctl only supports FIONREAD and FI...
Definition: mn_net_types.hpp:429
Definition: mn_allocator_typetraits.hpp:25