append socket code