NetworkSocket is just a very thin wrapper around either a file descriptor or a SOCKET depending on platform, along with a couple of helper methods for explicitly converting to/from file descriptors, even on Windows.
Synopsis
Declared in <folly/net/NetworkSocket.h>
struct NetworkSocket;
Type Aliases
Name |
Description |
The platform‐specific native socket handle type. |
Member Functions
Name |
Description |
|
Constructors |
Return the file descriptor associated with this NetworkSocket. |
Static Member Functions
Name |
Description |
|
Data Members
Name |
Description |
The underlying native socket handle. |
Static Data Members
Name |
Description |
The sentinel value representing an invalid socket handle. |
Friends
Name |
Description |
Compares two NetworkSockets for inequality. |
|
Compares two NetworkSockets for equality. |
Non-Member Functions
Name |
Description |
Applies the given socket options to a socket at the given position. |
|
Closes a network socket, retrying on EINTR. |
|
Shuts down a socket, retrying on EINTR. |
|
Accepts a connection on a listening socket. |
|
Binds a socket to a local address. |
|
Closes a socket. |
|
Connects a socket to a remote address. |
|
Retrieves the address of the connected peer. |
|
Retrieves the local address bound to a socket. |
|
Retrieves a socket option. |
|
Marks a socket as accepting connections. |
|
Receives data from a connected socket. |
|
Receives data and records the source address. |
|
Receives multiple messages in a single call. |
|
Receives a message, including ancillary data. |
|
Sends data on a connected socket. |
|
Sends multiple messages in a single call. |
|
Sends a message, including ancillary data. |
|
Sends data to a specific destination address. |
|
Puts a socket into blocking mode. |
|
|
Sets the close‐on‐exec flag on a socket. |
|
Puts a socket into non‐blocking mode. |
Sets a socket option. |
|
Shuts down part or all of a full‐duplex connection. |
|
Creates a socket. |
Created with MrDocs