Broken KIO connections

Thiago Macieira thiago at kde.org
Wed Apr 18 16:07:37 BST 2007


Harri Porten said:
> On Wed, 18 Apr 2007, Thiago Macieira wrote:
>
>>>> If you still get similar errors, get me a backtrace from a breakpoint
>>>> on
>>>> the qDebug() message.
>>>
>>> Now I'm getting 'Could not connect to host', with HTTP.
>
> Completely broken here with that change, too.

That's weird. I changed the tests to detect when a socket wasn't connected
but QIODevice::isOpen() returned true.

I don't understand how it could break anything for you: if the socket
isn't connected now for you, it mustn't have been connected in the first
place. So, how could it have been working?

If the socket is (and was) connected, the state should be ConnectedState.

The only thing I can think of is that the device was open and the socket
not connected, but in the process of connecting. This would show up with a
symptom of connections working randomly, because it would be a timing
issue (whether the socket had finished connecting or not). However, I find
that extremely unlikely, for two reasons: 1) there's a waitForConnected
call and 2) there's no event loop in ioslaves.

>> Put a breakpoint in KIO::TCPSlaveBase::connectToHost right after the
>> call
>> to KSocketFactory::synchronousConnectToHost. The returned value should
>> be
>> a valid QTcpSocket, in UnconnectedState. Print its errorString() so that
>> we know why the connection failed.
>>
>> Also, make sure that the hostname and port number passed to
>> synchronousConnectToHost are valid.
>>
>> [Alternatively, modify KSocketFactory to print a debugging message in
>> case
>> of failed connections.]
>
> Will try this tonight or tomorrow, too.

Print the socket state(), error, etc. All the information you can get on
the socket.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358






More information about the kde-core-devel mailing list