[Qt-interest] How can I get information of network disconnection

Sean Harmer sean.harmer at maps-technology.com
Fri Nov 6 10:26:06 CET 2009


Hi,

On Friday 06 Nov 2009 09:22:09 Rahulkumar Tibdewal wrote:
> Hello All,
> 
> I am working on client server application. When I unplug the network cable
>  for server, application running on server should know that its network is
>  disconnected. Is there any way I can receive signal in my code on server
>  side, which will tell me that network is disconnected?

Take a look at this:

http://doc.trolltech.com/4.6-snapshot/qabstractsocket.html#error-2

and 

http://doc.trolltech.com/4.6-snapshot/qabstractsocket.html#SocketError-enum

>From the second link:

QAbstractSocket::NetworkError  7  An error occurred with the network (e.g., 
the network cable was accidentally plugged out).

HTH,

Sean




More information about the Qt-interest-old mailing list