sta / sta/websocket-sharp

WebsocketServer never closes port properly

Open
#443 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Whenever I use the websocket server, then close it, I can never re-open that port (address in use).
Websocket client closes okay.
Client connects and sends messages fine.
I have to close the process before the port is free again.
No logging reported (so looking through code, but not yet stepped through, it should have at least tried to close the listener)
Using in unity, (using experimental 4.6 .net) on OSX. Built DLL in visual studio community.

this.Socket = new WebSocketServer(LocalAddress, Port);
this.Socket.Start();
and later
this.Socket.Stop();

Will be stepping through the Stop() code shortly

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with WebSocketServer.Start() and Stop() using the Unity/OSX setup described, then step through the Stop() code and listener lifecycle. Confirm that the port remains unavailable after Stop() and identify what prevents the listener from being closed. Done means the same port can be reopened after stopping without terminating the process.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.