Debugging socket code