Then you are running a program in a remote server over telnet, ssh, etc, the program will be killed when your connection is closed.
A way to avoid it is using the screen program:
Ctrl-A and then Ctrl-D
You can reconnect to the server you can attach back to your application using the command:
$ screen -r