xtd 0.2.0
Loading...
Searching...
No Matches

◆ socket_type

enum class xtd::net::sockets::socket_type
strong

Specifies the type of socket that an instance of the xtd::net::sockets::socket class represents.

enum class socket_type
socket_type
Specifies the type of socket that an instance of the xtd::net::sockets::socket class represents.
Definition socket_type.h:32
Header
#include <xtd/net/sockets/socket_type>
Namespace
xtd::net::sockets
Library
xtd.core
Remarks
Before a xtd::net::sockets::socket can send and receive data, it must first be created using an xtd::net::sockets::address_family, a xtd::net::sockets::socket_type, and a xtd::net::sockets::protocol_type. The xtd::net::sockets::socket_type enumeration provides several options for defining the type of xtd::net::sockets::socket that you intend to open.
Note
xtd::net::sockets::socket_type will sometimes implicitly indicate which xtd::net::sockets::protocol_type will be used within an xtd::net::sockets::address_family. For example when the xtd::net::sockets::socket_type is xtd::net::sockets::socket_typedgram, the xtd::net::sockets::protocol_type is always xtd::net::sockets::protocol_type::udp. When the xtd::net::sockets::socket_type is xtd::net::sockets::socket_type::stream, the xtd::net::sockets::protocol_type is always xtd::net::sockets::protocol_type::tcp. If you try to create a xtd::net::sockets::socket with an incompatible combination, xtd::net::sockets::socket will throw a xtd::net::sockets::socket_exception.
Enumerator
unknown 

Specifies an unknown xtd::net::sockets::socket type.

stream 

Supports reliable, two-way, connection-based byte streams without the duplication of data and without preservation of boundaries. A xtd::net::sockets::socket of this type communicates with a single peer and requires a remote host connection before communication can begin. xtd::net::sockets::socket_types::stream uses the Transmission Control Protocol (xtd::net::sockets::protocol_type::tcp) and the xtd::net::sockets::address_family::inter_network address family.

dgram 

Supports datagrams, which are connectionless, unreliable messages of a fixed (typically small) maximum length. Messages might be lost or duplicated and might arrive out of order. A xtd::net::sockets::socket of type xtd::net::sockets::socket_type::dgram requires no connection prior to sending and receiving data, and can communicate with multiple peers. xtd::net::sockets::socket_type::dgram uses the Datagram Protocol (xtd::net::sockets::protocol_type::udp) and the xtd::net::sockets::address_family::inter_network address family.

raw 

Supports access to the underlying transport protocol. Using the xtd::net::sockets::socket_type::raw, you can communicate using protocols like Internet Control Message Protocol (xtd::net::sockets::protocol_type::icmp) and Internet Group Management Protocol (xtd::net::sockets::protocol_type::Igmp). Your application must provide a complete IP header when sending. Received datagrams return with the IP header and options intact.

rdm 

Supports connectionless, message-oriented, reliably delivered messages, and preserves message boundaries in data. xtd::net::sockets::socket_type::rdm (Reliably Delivered Messages) messages arrive unduplicated and in order. Furthermore, the sender is notified if messages are lost. If you initialize a xtd::net::sockets::socket using xtd::net::sockets::socket_type::rdm, you do not require a remote host connection before sending and receiving data. With xtd::net::sockets::socket_typerdm, you can communicate with multiple peers.

seqpacket 

Provides connection-oriented and reliable two-way transfer of ordered byte streams across a network. xtd::net::sockets::socket_type::seqpacket does not duplicate data, and it preserves boundaries within the data stream. A xtd::net::sockets::socket of type xtd::net::sockets::socket_type::seqpacket communicates with a single peer and requires a remote host connection before communication can begin.