close socket and realease memory when return 2 in case 200