Example socket code