diff --git a/Cargo.toml b/Cargo.toml index d77be28c..d3b0b387 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "laminar" -version = "0.2.3" +version = "0.3.0" authors = [ "Lucio Franco ", "Fletcher Haynes ", diff --git a/README.md b/README.md index 1bc473b3..db968361 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Add the laminar package to your `Cargo.toml` file. ```toml [dependencies] -laminar = "0.2.3" +laminar = "0.3.0" ``` ### Useful Links @@ -90,7 +90,8 @@ _Send packets_ use laminar::{Socket, Packet}; // create the socket -let (mut socket, packet_sender, _) = Socket::bind("127.0.0.1:12345")?; +let mut socket = Socket::bind("127.0.0.1:12345")?; +let packet_sender = socket.get_packet_sender(); // this will start the socket, which will start a poll mechanism to receive and send messages. let _thread = thread::spawn(move || socket.start_polling()); @@ -119,12 +120,13 @@ _Receive Packets_ use laminar::{SocketEvent, Socket}; // create the socket -let (mut socket, _, packet_receiver) = Socket::bind("127.0.0.1:12346")?; +let socket = Socket::bind("127.0.0.1:12346")?; +let event_receiver = socket.get_event_receiver(); // this will start the socket, which will start a poll mechanism to receive and send messages. let _thread = thread::spawn(move || socket.start_polling()); // wait until a socket event occurs -let result = packet_receiver.recv(); +let result = event_receiver.recv(); match result { Ok(socket_event) => { diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d5f90a4d..e5b1da57 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,14 @@ # Change Log This document contains information about the releases of this crate. -## [0.2.3] - 2019-16-13 +## [0.3.0] - 2019-06-29 +- Moved the packet sender and event receiver into socket struct +- Exposed internal SocketAddr +- Introduced a new method to manually step through the polling loop +- Added a number of #[derive(Debug)] lines to Socket and member types +- Implemented basic DoS mitigation +- Added a customizable sleep to the polling loop. Defaults to 1ms + +## [0.2.3] - 2019-06-13 - Remove error 'WouldBlock' ## [0.2.2] - 2019-05-06