Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle broken pipes #49

Open
topheman opened this issue Mar 3, 2024 · 0 comments
Open

Handle broken pipes #49

topheman opened this issue Mar 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@topheman
Copy link
Owner

topheman commented Mar 3, 2024

Reproduce:

Terminal 1: run snakepipe gamestate|snakepipe render-browser

Terminal 2: run snakepipe gamestate|snakepipe render-browser

In terminal 2, you get the error:

Error: port 8080 already in use
thread 'main' panicked at library/std/src/io/stdio.rs:1021:9:
failed printing to stdout: Broken pipe (os error 32)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Because

  1. the port 8080 is already in use (normal)
  2. Since snakepipe render-browser exit, its stdin doesn't exist anymore, so snakepipe gamestate can't write to it via its stdout

Maybe rely on https://crates.io/crates/calm_io

It might be a solution for #25

Example of use:

@topheman topheman self-assigned this Mar 3, 2024
topheman added a commit that referenced this issue Mar 3, 2024
@topheman topheman added the bug Something isn't working label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant