The close method of Socket class should return itself