trillium-rs / trillium

Trillium is a composable toolkit for building internet applications with async rust

Home Page:https://trillium.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug report for `trillium-async-std`: Ctrl-C crashes the server on Windows

quixoticaxis opened this issue · comments

Describe the bug
The handling of Ctrl-C currently fails on Windows: pressing Ctrl-C leads to crash.

To Reproduce

  1. Run the following code:
fn main() {
    trillium_async_std::config()
        .with_host("127.0.0.1")
        .with_port(7878)
        .run(|conn: Conn| async move { conn.ok("It will fail")})
}
  1. Press Ctrl-C.
  2. The server would crash with the following message:

error: process didn't exit successfully: target\debug\trillium-fun.exe (exit code: 0xc000013a, STATUS_CONTROL_C_EXIT)

Expected behavior
The server stops gracefully.

Screenshots
Not applicable.

Desktop

  • OS: Windows 11 (Microsoft Windows [Version 10.0.22000.593])
  • Browser: does not matter
  • Version: from cargo.lock, trillium 0.2.2, trillium-asyn-std 0.2.0

Additional context
Just in case I checked the other adapters: trillium-tokio and trillium-smol fail in the same way.