Added a first, basic polling loop that reads from sockets.