Skip to content

Conversation

@Pawank06
Copy link
Contributor

@Pawank06 Pawank06 commented Dec 1, 2025

This PR introduces safer and more graceful error handling in the Simnet threading flow:

  • Replace process exit with event-based error propagation in simnet thread
  • Add port availability validation before starting RPC and WebSocket servers
  • Extract port checking logic into reusable check_port_availability function
  • Print error messages to stderr for better visibility when ports are in use
  • Remove unnecessary sleep and direct process exit calls
  • Provide clearer error messages when address binding fails
  • Allow graceful error handling through the event channel instead of abrupt termination

Before:
Screenshot 2025-12-02 at 12 15 43 AM

After:
Screenshot 2025-12-02 at 12 16 24 AM

fixes: #438

- Replace process exit with event-based error propagation in simnet thread
- Add port availability validation before starting RPC and WebSocket servers
- Extract port checking logic into reusable check_port_availability function
- Print error messages to stderr for better visibility when ports are in use
- Remove unnecessary sleep and direct process exit calls
- Provide clearer error messages when address binding fails
- Allow graceful error handling through the event channel instead of abrupt termination
@Pawank06
Copy link
Contributor Author

Pawank06 commented Dec 1, 2025

@MicaiahReid ser can you please check this PR? thank you!

Copy link
Member

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, thanks @Pawank06!

@MicaiahReid MicaiahReid merged commit 365c574 into txtx:main Dec 2, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add better error messaging when starting a surfnet on the same port as another network

2 participants