This looks an awful lot like a blocking call to connect() with a 3 minute timeout. Now, it's one thing when you have a blocking connect() call that hangs the game, is it quite another when your game blocks alt-tab, ctrl-alt-del, and prevents other windows from being displayed over it (such as taskman.exe). You are hijacking the system and effectively hanging it thanks to bad code. Running in Windowed mode is the workaround, but in all honesty, a complete system hijack is not the correct way to do things.
Please, let users use the system escape facilities, even if you don't fix your network code. The first time this happened to me I assumed my system was locked up and hit reset (nothing else would respond). I lost some work I was doing in the background because of this.