Opening server with port in use

Hello,

when trying to initialize a server with a port thats already in use Unity throws an Exception. This Exception however cannot be catched with a try-catch block (I’m using C#).
How are we supposed to register, if the port is already in use?

The way I see it you should either store this error in the enum returned by Network.InitializeServer or let us catch this excepton properly. Another option would be to find an open port automatically. The status quo however is unacceptable.

It does not throw an exception. It just displays the error in the log. Network.InitializeServer returns an enum which indicates success or not.

If the socket or port is already in use you get a CreateSocketOrThreadFailure enum value.

I’m not at my machine right now, so i cant post the code. However the enum returned is NoError. Will test further tomorow.

€: After further testing I found the source of my confusion. I expected it to throw an Exception, as I’m used to from writing Network-Apps. So the following Errors were just symptoms of this misassumption.
Thanks for clearing that up larus.