Add more socket options.

This commit is contained in:
chris 2004-01-13 01:12:57 +00:00
parent 820b087c75
commit 020bfe6728
3 changed files with 22 additions and 8 deletions

View File

@ -1,13 +1,6 @@
asio to-do items
================
Add more socket options
-----------------------
Add support for additional socket options beyond the sample few that exist now.
May want to consider not exposing the option for non-blocking I/O, and simply
state that using the asynchronous operations is the portable way to go about
it.
Add vectored send/recv functions
--------------------------------
Add the sendv and recvv functions to basic_stream_socket and presumably also to

View File

@ -43,7 +43,7 @@ public:
}
/// Socket option for disabling the Nagle algorithm.
typedef socket_option::flag<IPPROTO_TCP, TCP_NODELAY> tcp_no_delay;
typedef socket_option::flag<IPPROTO_TCP, TCP_NODELAY> no_delay;
};
} // namespace ipv4

View File

@ -150,12 +150,33 @@ private:
int value_;
};
/// Permit sending of broadcast messages.
typedef flag<SOL_SOCKET, SO_BROADCAST> broadcast;
/// Prevent routing, use local interfaces only.
typedef flag<SOL_SOCKET, SO_DONTROUTE> dont_route;
/// Send keep-alives.
typedef flag<SOL_SOCKET, SO_KEEPALIVE> keep_alive;
/// The receive buffer size for a socket.
typedef integer<SOL_SOCKET, SO_SNDBUF> send_buffer_size;
/// Send low watermark.
typedef integer<SOL_SOCKET, SO_SNDLOWAT> send_low_watermark;
/// Send timeout.
typedef integer<SOL_SOCKET, SO_SNDTIMEO> send_timeout;
/// The send buffer size for a socket.
typedef integer<SOL_SOCKET, SO_RCVBUF> recv_buffer_size;
/// Receive low watermark.
typedef integer<SOL_SOCKET, SO_RCVLOWAT> recv_low_watermark;
/// Receive timeout.
typedef integer<SOL_SOCKET, SO_RCVTIMEO> recv_timeout;
/// Allow the socket to be bound to an address that is already in use.
typedef flag<SOL_SOCKET, SO_REUSEADDR> reuse_address;