diff --git a/Cargo.lock b/Cargo.lock index 24053e6..9bc4274 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "afire" -version = "0.1.6" +version = "0.1.7" dependencies = [ "afire", ] diff --git a/Cargo.toml b/Cargo.toml index a8e4c76..8eb08df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "afire" -version = "0.1.6" +version = "0.1.7" authors = ["Connor Slade "] edition = "2018" diff --git a/Changelog.md b/Changelog.md index 2c5d46f..7a10b4f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,11 +1,12 @@ -# 0.1.7* +# 0.1.7 - Add Panic Message to Error Handel - Add http.rs to move raw http parseing out of server.rs - Start / Start Threaded returns Option - Add .unwrap to all server.starts in examples - Add http.rs to move raw http parsing out of server.rs -- Add optinal Socket Timeout - Dont give up on cookie parsing if cookie header is malformed +- Add optinal Socket Timeout +- Add Socket Timeout Docs # 0.1.6 - Add Example for Logging diff --git a/README.md b/README.md index e1e9d3c..964dab9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Just add the following to your `Cargo.toml`: ```toml [dependencies] -afire = "0.1.6" +afire = "0.1.7" ``` ## 📄 Info diff --git a/lib/lib.rs b/lib/lib.rs index bfb236e..ec134be 100644 --- a/lib/lib.rs +++ b/lib/lib.rs @@ -9,7 +9,7 @@ Just add the following to your `Cargo.toml`: ```toml [dependencies] -afire = "0.1.6" +afire = "0.1.7" ``` ## 📄 Info @@ -81,7 +81,7 @@ server.start_threaded(8); #![warn(missing_docs)] -pub(crate) const VERSION: &str = "0.1.7*"; +pub(crate) const VERSION: &str = "0.1.7"; mod common; mod http; diff --git a/lib/server.rs b/lib/server.rs index bf791d1..c33d589 100644 --- a/lib/server.rs +++ b/lib/server.rs @@ -378,6 +378,25 @@ impl Server { .push(header); } + /// Set the socket Read / Write Timeout + /// + /// ## Example + /// ```rust + /// // Import Library + /// use std::time::Duration; + /// use afire::Server; + /// + /// // Create a server for localhost on port 8080 + /// let mut server: Server = Server::new("localhost", 8080); + /// + /// // Set socket timeout + /// server.set_socket_timeout(Some(Duration::from_secs(1))); + /// + /// // Start the server + /// // As always, this is blocking + /// # server.set_run(false); + /// server.start().unwrap(); + /// ``` pub fn set_socket_timeout(&mut self, socket_timeout: Option) { self.socket_timeout = socket_timeout; }