TAAFT
Free mode
100% free
Freemium
Free Trial
Deals

Netlib

togglebyte / netlib

Network library in Rust using Epoll

2 0 Language: Rust License: MIT Updated: 2y ago

README

Netlib

Requirements

  • Should work with std:
    • TcpListener / TcpStream
    • Unix domain socket
    • Stdin / Stdout
  • Should be batteries included
    • Buffers
    • Connection<T: Read + Write, U: Buffer>
  • As few dependencies as possible
  • Should not allow blocking sockets

Api

Questions: error handling?

// Create a game loop (ticks every N ms)
let game_loop = GameLoopTimer::new();

// Setup networking
let listener = TcpListener::bind("0.0.0.0:9000")?;
let connection_handler = ConnectionHandler::new();

// listener -> connection handler
let networking = listener.chain(connection_handler);

// join the game loop with the networking component
let game = game_loop.join(networking)

system.start(game);

System -> [listener] -> [tcp stream] -> ?how do we register this stream

  • Make System TLS
0 AIs selected
Clear selection
#
Name
Task