Created a socket and bind it to port 80

Changed some error handling in daemon.cpp