Added socket event handler to project. DRYed up socket connection creation