How to shutdown a server

Hi. I need to be able to shutdown a server, created with Network.InitializeServer().
Everything I have seen so far uses Network.Disconnect(), which according to the documentation shuts down the network interface. This seems to be the reason why I get this error message when I am accessing the MasterServer after the call to Network.Disconnect():

Already connected to the master server, the server probably hasn’t cleaned up because of an abrupt disconnection.

Is there a way to just shut down the server and be able to use the port again, while maintaining connectivity to MasterServer?
Currently after Network.Disconnect() application behavior seems to be random.

Thanks.

Hey, try this:

        Network.Disconnect();
        MasterServer.UnregisterHost();