Initialize socket handler.