Double fork seems to not really work, so I'll be using nohup for the time being. Added atexit handler to properly close the socket file descriptor