Added signal handling to server.
Added check if nonblocking opening failed.