kerryjiang / SuperWebSocket

SuperWebSocket is a .NET implementation of WebSocket server.
Apache License 2.0
505 stars 194 forks source link

Binding to port 0 #17

Open ddevault opened 9 years ago

ddevault commented 9 years ago

When you bind to port 0, the system assigns you some unspecified available port. This is only useful if you can get that port back from SuperWebSocket, but it does not seem to expose the endpoint of the listener.

ddevault commented 9 years ago

Example use-case: https://github.com/SirCmpwn/mdedit/blob/master/MDService.cs#L33-L34

vspin commented 8 years ago

Same issue for me as well. I have game servers that are created dynamically, and I can't seem to retrieve the server port without doing some hacky coding.

kerryjiang commented 8 years ago

Probably you can implement this feature using endpoint runtime replacement like the code below: https://raw.githubusercontent.com/kerryjiang/SuperSocket/v1.6/QuickStart/WindowsAzure/SuperSocketRole/WorkerRole.cs