mbroadst / qamqp

AMQP 0.9.1 implementation for Qt
Other
151 stars 128 forks source link

QAbstractSocket::SocketError catching (a question) #6

Closed alexalv closed 10 years ago

alexalv commented 10 years ago

Is there currently a valid way to know that something like a SocketError happened while an attempt to establish connection with remote server. For example I'm trying to establish a connection from my program and calling something like m_client.connectToHost(ConnectionString) and I have a mistake in ConnectionString or remote amqp server is down, is there any way to have immediate feedback about that? Thanks!

mbroadst commented 10 years ago

There currently isn't any forwarding of socket errors, but that should indeed be added. The best bet you have with the current state of the code is to check the QAMQP::Error signaled by the client's error signal (or exchange/queue). Also, you can run your test program with the environment variable QAMQP_DEBUG=1 set, and that will show a ton of debug information.

I'm going to keep this ticket open for now to remind me to provide public access to the socket state and errors in the future. Thanks!

mbroadst commented 10 years ago

fixed with 98f40f5589f799a326b031c926e1149b7edb7b92

alexalv commented 10 years ago

Wow, that was fast! Thank you :)

mbroadst commented 10 years ago

@alexalv np, your feedback is really important (especially now since the API is still a bit "in flux"), so please let me know if you're having any other difficulties :)