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_type.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 {
29  enum class socket_type {
31  unknown = -1,
33  stream = 1,
35  dgram = 2,
37  raw = 3,
39  rdm = 4,
41  seqpacket = 5,
42  };
43 
45  inline std::ostream& operator<<(std::ostream& os, socket_type value) {return os << to_string(value, {{socket_type::unknown, "unknown"}, {socket_type::stream, "stream"}, {socket_type::dgram, "dgram"}, {socket_type::raw, "raw"}, {socket_type::rdm, "rdm"}, {socket_type::seqpacket, "seqpacket"}});}
46  inline std::wostream& operator<<(std::wostream& os, socket_type value) {return os << to_string(value, {{socket_type::unknown, L"unknown"}, {socket_type::stream, L"stream"}, {socket_type::dgram, L"dgram"}, {socket_type::raw, L"raw"}, {socket_type::rdm, L"rdm"}, {socket_type::seqpacket, L"seqpacket"}});}
48  }
49  }
50 }
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 connection-oriented and reliable two-way transfer of ordered byte streams across a network...
Supports connectionless, message-oriented, reliably delivered messages, and preserves message boundar...
Supports datagrams, which are connectionless, unreliable messages of a fixed (typically small) maximu...
socket_type
Specifies the type of socket that an instance of the xtd::net::sockets::socket class represents...
Definition: socket_type.h:29
Supports reliable, two-way, connection-based byte streams without the duplication of data and without...