SoftwareGuy / Ignorance

Ignorance utilizes the power of ENet to provide a reliable UDP networking transport for Mirror Networking.
Other
248 stars 31 forks source link

The port not be closed #49

Closed SkaiXu closed 4 years ago

SkaiXu commented 5 years ago

Version 1.3.0 gold release. Unity 2018.4.5 I started host for several times in editor. And stop then run again. Throw the exception: Host creation call failed. I used the cmd to check the ports. The editor is still using that port after stop run. I don't know if it will cause the problem on other platform. So if it's possible to stop the port after running?

SoftwareGuy commented 5 years ago

This seems to be an issue regarding to Unity Editor and native C/C++ libraries. Unfortunately, even if I've shut down ENET and Deinitialized it, the UDP port can still linger around. Are the shutdowns clean and don't emit errors?

Upstream has me blocked so I can't ask there, but let me contact one of the Mirror team members for further clarification.

How fast did you click Start and Stop Server buttons (if you're using NetworkManagerHUD)? I've only seen this happen if you spam click the buttons in NetworkManagerHUD. Are you spawning only a single server, or are you trying to bind multiple servers to one port?

Also please enable Debug Mode on the Ignorance inspector and then see if you get any messages that say along the lines of DEBUGGING MODE - ServerStop() when you stop the play mode.

What version of Mirror are you using?

SkaiXu commented 5 years ago

There is no errors. I was not using the HUD. Just press the run and stop in the editor. Most of the time, everything is ok. Only a few time, it cause the problem. Now it happened 2 or 3 times. Yes, I have only one single server. Only the editor is running, so it can just only one server bind the port. I will try to use the debug mode when it happend again, Thanks a lot. And the version of mirros is 3.11.6

SoftwareGuy commented 4 years ago

Going to close this, please reopen if the issue happens again. :)