Debugging socket connection error