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_type.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 {
26 enum class socket_type {
28 unknown = -1,
30 stream = 1,
32 dgram = 2,
34 raw = 3,
36 rdm = 4,
38 seqpacket = 5,
39 };
40
42 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"}});}
43 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"}});}
45 }
46 }
47}
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_type
Specifies the type of socket that an instance of the xtd::net::sockets::socket class represents.
Definition: socket_type.h:26
@ unknown
Unknown address family.
@ raw
Raw IP packet protocol.
@ rdm
Supports connectionless, message-oriented, reliably delivered messages, and preserves message boundar...
@ unknown
Specifies an unknown xtd::net::sockets::socket type.
@ seqpacket
Provides connection-oriented and reliable two-way transfer of ordered byte streams across a network....
@ raw
Supports access to the underlying transport protocol. Using the xtd::net::sockets::socket_type::raw,...
@ stream
Supports reliable, two-way, connection-based byte streams without the duplication of data and without...
@ dgram
Supports datagrams, which are connectionless, unreliable messages of a fixed (typically small) maximu...
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17