How to stop listen server?

I’m trying to use GetWorld()->Listen in C++ to run a listen server, but I’m having issues with getting clients (especially pending clients) to disconnect properly when the connection is lost. What’s the correct way to stop a listen server? How and where should clients handle destroying their own sessions as a result of the listen server stopping? Is there a way to stop clients from loading maps when connected to or disconnecting from a server? Thanks.

I’m trying to do this in 4.10 but am not sure how to. I can kick all the clients from my game by calling Shutdown on the NetDriver but they can still connect to my listen server by using the open “” command.


I have the same question.
I collect players in a lobby map listening for login, then I server travel to a gameplay map.
I don’t want my gameplay map being found by other client “Find Sessions”.
How do I do?

I’m looking at this right now as well. It looks like the listen function checks if a server is already running and then closes it if it is running. If you now call listen again with port 0 then the server is stopped but new one can’t be created on port 0.