xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
socket_flags.h
Go to the documentation of this file.
1
4#pragma once
5
6#include "../../ustring.h"
7
9#undef unix
11
13namespace xtd {
15 namespace net {
17 namespace sockets {
24 enum class socket_flags {
26 none = 0x0000,
28 out_of_band = 0x0001,
30 peek = 0x0002,
32 dont_route = 0x0004,
34 max_io_vector_length = 0x0010,
36 truncated = 0x0100,
40 broadcast = 0x0400,
42 multicast = 0x0800,
44 partial = 0x8000,
45 };
46
48 inline socket_flags& operator^=(socket_flags& lhs, socket_flags rhs) {lhs = static_cast<socket_flags>(static_cast<int>(lhs) ^ static_cast<int>(rhs)); return lhs;}
49 inline socket_flags& operator&=(socket_flags& lhs, socket_flags rhs) {lhs = static_cast<socket_flags>(static_cast<int>(lhs) & static_cast<int>(rhs)); return lhs;}
50 inline socket_flags& operator|=(socket_flags& lhs, socket_flags rhs) {lhs = static_cast<socket_flags>(static_cast<int>(lhs) | static_cast<int>(rhs)); return lhs;}
51 inline socket_flags& operator+=(socket_flags& lhs, socket_flags rhs) {lhs = static_cast<socket_flags>(static_cast<int>(lhs) + static_cast<int>(rhs)); return lhs;}
52 inline socket_flags& operator-=(socket_flags& lhs, socket_flags rhs) {lhs = static_cast<socket_flags>(static_cast<int>(lhs) - static_cast<int>(rhs)); return lhs;}
53 inline socket_flags operator^(socket_flags lhs, socket_flags rhs) {return static_cast<socket_flags>(static_cast<int>(lhs) ^ static_cast<int>(rhs));}
54 inline socket_flags operator&(socket_flags lhs, socket_flags rhs) {return static_cast<socket_flags>(static_cast<int>(lhs) & static_cast<int>(rhs));}
55 inline socket_flags operator|(socket_flags lhs, socket_flags rhs) {return static_cast<socket_flags>(static_cast<int>(lhs) | static_cast<int>(rhs));}
56 inline socket_flags operator+(socket_flags lhs, socket_flags rhs) {return static_cast<socket_flags>(static_cast<int>(lhs) + static_cast<int>(rhs));}
57 inline socket_flags operator-(socket_flags lhs, socket_flags rhs) {return static_cast<socket_flags>(static_cast<int>(lhs) - static_cast<int>(rhs));}
58 inline socket_flags operator~(socket_flags lhs) {return static_cast<socket_flags>(~static_cast<int>(lhs));}
59 inline std::ostream& operator<<(std::ostream& os, socket_flags value) {return os << to_string(value, {{socket_flags::none, "none"}, {socket_flags::out_of_band, "out_of_band"}, {socket_flags::peek, "peek"}, {socket_flags::dont_route, "dont_route"}, {socket_flags::max_io_vector_length, "max_io_vector_length"}, {socket_flags::truncated, "truncated"}, {socket_flags::control_data_truncated, "control_data_truncated"}, {socket_flags::broadcast, "broadcast"}, {socket_flags::multicast, "multicast"}, {socket_flags::partial, "partial"}});}
60 inline std::wostream& operator<<(std::wostream& os, socket_flags value) {return os << to_string(value, {{socket_flags::none, L"none"}, {socket_flags::out_of_band, L"out_of_band"}, {socket_flags::peek, L"peek"}, {socket_flags::dont_route, L"dont_route"}, {socket_flags::max_io_vector_length, L"max_io_vector_length"}, {socket_flags::truncated, L"truncated"}, {socket_flags::control_data_truncated, L"control_data_truncated"}, {socket_flags::broadcast, L"broadcast"}, {socket_flags::multicast, L"multicast"}, {socket_flags::partial, L"partial"}});}
62 }
63 }
64}
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: to_string.h:37
socket_flags
Specifies socket send and receive behaviors. This enumeration has a flags attribute that allows a bit...
Definition: socket_flags.h:24
@ none
none of the socket operations.
@ partial
Partial send or receive for message.
@ control_data_truncated
Indicates that the control data did not fit into an internal 64-KB buffer and was truncated.
@ none
Use no flags for this call.
@ max_io_vector_length
Provides a standard value for the number of WSABUF structures that are used to send and receive data.
@ multicast
Indicates a multicast packet.
@ peek
Peek at the incoming message.
@ truncated
The message was too large to fit into the specified buffer and was truncated.
@ dont_route
Send without using routing tables.
@ broadcast
Indicates a broadcast packet.
@ out_of_band
Process out-of-band data.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17