Added reactor function to create new socket