Moved socket and poll under utils.