xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
socket_flags.h
Go to the documentation of this file.
1 #pragma once
5 
6 #include "../../ustring.h"
7 
9 #undef unix
10 
13 namespace xtd {
15  namespace net {
17  namespace sockets {
27  enum class socket_flags {
29  none = 0x0000,
31  out_of_band = 0x0001,
33  peek = 0x0002,
35  dont_route = 0x0004,
37  max_io_vector_length = 0x0010,
39  truncated = 0x0100,
41  control_data_truncated = 0x0200,
43  broadcast = 0x0400,
45  multicast = 0x0800,
47  partial = 0x8000,
48  };
49 
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) {lhs = static_cast<socket_flags>(static_cast<int>(lhs) | static_cast<int>(rhs)); return lhs;}
54  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;}
55  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;}
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, socket_flags rhs) {return static_cast<socket_flags>(static_cast<int>(lhs) | static_cast<int>(rhs));}
59  inline socket_flags operator+(socket_flags lhs, socket_flags rhs) {return static_cast<socket_flags>(static_cast<int>(lhs) + static_cast<int>(rhs));}
60  inline socket_flags operator-(socket_flags lhs, socket_flags rhs) {return static_cast<socket_flags>(static_cast<int>(lhs) - static_cast<int>(rhs));}
61  inline socket_flags operator~(socket_flags lhs) {return static_cast<socket_flags>(~static_cast<int>(lhs));}
62  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"}});}
63  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"}});}
65  }
66  }
67 }
Send without using routing tables.
Use no flags for this call.
Indicates that the control data did not fit into an internal 64-KB buffer and was truncated...
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1110
Provides a standard value for the number of WSABUF structures that are used to send and receive data...
Indicates a multicast packet.
socket_flags
Specifies socket send and receive behaviors. This enumeration has a flags attribute that allows a bit...
Definition: socket_flags.h:27
The message was too large to fit into the specified buffer and was truncated.
Partial send or receive for message.
Peek at the incoming message.
Indicates a broadcast packet.