Taper is a Rust library made for easy packet based network communication.
Taper supports async usage with the async
feature.
When enabled, taper will use Tokio to execute concurrently all packet listener.
If disabled, OS Threads are used instead
While this may be overkill for Clients, this may be a great performance improvement for Servers.
```rust use taper::Server;
// Try to bind server for listening on localhost and port 1234
// Using u32 packets
let server = Server::
// Wait for the connection of a single socket let socket = server.event_receiver().recv().unwrap();
// Do whatever you want with the socket! ```
```rust use taper::{Socket, SocketEvent};
let socket = Socket::
socket.packet_sender().send(56745).unwrap();
loop { match socket.event_receiver().recv().unwrap() { SocketEvent::Packet(packet) => println!("Received a packet from the server: {}", packet), SocketEvent::InvalidPacket => println!("The server sent an invalid packet :("), SocketEvent::IoError(error) => println!("An error occurred {}", error), } } ```
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.