Fix http server issue. Need to check if we have data already when the socket is closed, change to nonblocking socket means 0 is not always an error condition
don't forget to break...