Onclose and the close method work for multi sockets