Bind the socket events based on an socketEvents object which can be augmented by client code.