summaryrefslogtreecommitdiff
path: root/src/sys/socket/mod.rs
diff options
context:
space:
mode:
authorNicolas Dusart <dusartnicolas@gmail.com>2017-07-26 10:52:41 +0200
committerNicolas Dusart <dusartnicolas@gmail.com>2017-08-01 09:51:30 +0200
commitb476839a40f81ac7c4f0c74c8d23fdd94155b260 (patch)
tree68607fab90ee0c805ee10f626eaa60e72e858e25 /src/sys/socket/mod.rs
parent22b8b33f436d7b05255682374eb42c629fed5e35 (diff)
downloadnix-b476839a40f81ac7c4f0c74c8d23fdd94155b260.zip
Document AddressFamily and SockType
Diffstat (limited to 'src/sys/socket/mod.rs')
-rw-r--r--src/sys/socket/mod.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index c2e95cbb..86129fcf 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -50,13 +50,27 @@ pub use self::multicast::{
pub use libc::sockaddr_storage;
+/// These constants are used to specify the communication semantics
+/// when creating a socket with [`socket()`](fn.socket.html)
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[repr(i32)]
pub enum SockType {
+ /// Provides sequenced, reliable, two-way, connection-
+ /// based byte streams. An out-of-band data transmission
+ /// mechanism may be supported.
Stream = libc::SOCK_STREAM,
+ /// Supports datagrams (connectionless, unreliable
+ /// messages of a fixed maximum length).
Datagram = libc::SOCK_DGRAM,
+ /// Provides a sequenced, reliable, two-way connection-
+ /// based data transmission path for datagrams of fixed
+ /// maximum length; a consumer is required to read an
+ /// entire packet with each input system call.
SeqPacket = libc::SOCK_SEQPACKET,
+ /// Provides raw network protocol access.
Raw = libc::SOCK_RAW,
+ /// Provides a reliable datagram layer that does not
+ /// guarantee ordering.
Rdm = libc::SOCK_RDM,
}