update Socket and add sort