Create method to add handler to socket from outside the class, needed in
order to add mock handler created in tests.