Simplified socket code