redis socket code