From 020bfe672811433e1dbd75d3d8b50cbc4aef6560 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 13 Jan 2004 01:12:57 +0000 Subject: [PATCH] Add more socket options. --- asio/TODO | 7 ------- asio/include/asio/ipv4/tcp.hpp | 2 +- asio/include/asio/socket_option.hpp | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/asio/TODO b/asio/TODO index 0a0064e9..6d3e83d2 100644 --- a/asio/TODO +++ b/asio/TODO @@ -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 diff --git a/asio/include/asio/ipv4/tcp.hpp b/asio/include/asio/ipv4/tcp.hpp index 828024dc..101662d7 100644 --- a/asio/include/asio/ipv4/tcp.hpp +++ b/asio/include/asio/ipv4/tcp.hpp @@ -43,7 +43,7 @@ public: } /// Socket option for disabling the Nagle algorithm. - typedef socket_option::flag tcp_no_delay; + typedef socket_option::flag no_delay; }; } // namespace ipv4 diff --git a/asio/include/asio/socket_option.hpp b/asio/include/asio/socket_option.hpp index acc548b3..9a962e4c 100644 --- a/asio/include/asio/socket_option.hpp +++ b/asio/include/asio/socket_option.hpp @@ -150,12 +150,33 @@ private: int value_; }; +/// Permit sending of broadcast messages. +typedef flag broadcast; + +/// Prevent routing, use local interfaces only. +typedef flag dont_route; + +/// Send keep-alives. +typedef flag keep_alive; + /// The receive buffer size for a socket. typedef integer send_buffer_size; +/// Send low watermark. +typedef integer send_low_watermark; + +/// Send timeout. +typedef integer send_timeout; + /// The send buffer size for a socket. typedef integer recv_buffer_size; +/// Receive low watermark. +typedef integer recv_low_watermark; + +/// Receive timeout. +typedef integer recv_timeout; + /// Allow the socket to be bound to an address that is already in use. typedef flag reuse_address;