Firewalls actively check connections, they can terminate one just as quick as you can blink.
Secondly, scripts can cause the problem if the client is corrupted, or you manage to run into a bug. Possibly a DLL has been called and is not using $dllcall and is cause the program to hang by endless loop or waiting for some response or just waiting.
make sure you know what you are loading if the script/dll is the case.