sinja
7th October 2009, 14:26
Hi,
I am writing a small client server application and I came upon a small problem (for qt experts), but quite big for me.
How can the Client see if there is a server present without communicating with him .?
For client I am using QSocketDevice.
Here is a small sequence of code.
_socket = new QSocketDevice(QSocketDevice::Stream);
_socket->setBlocking(false);
bConnect = _socket->connect(_addr, _port);
if(true == bConnect)
{
//do something
}
as you can see I have tried using connect function. I allways get bConnect==false. However I know the connection is properly made because later on if I ignor the "if(true == bConnect)" ...I get incoming data from server...
So...any other ideeas
Thank you
I am writing a small client server application and I came upon a small problem (for qt experts), but quite big for me.
How can the Client see if there is a server present without communicating with him .?
For client I am using QSocketDevice.
Here is a small sequence of code.
_socket = new QSocketDevice(QSocketDevice::Stream);
_socket->setBlocking(false);
bConnect = _socket->connect(_addr, _port);
if(true == bConnect)
{
//do something
}
as you can see I have tried using connect function. I allways get bConnect==false. However I know the connection is properly made because later on if I ignor the "if(true == bConnect)" ...I get incoming data from server...
So...any other ideeas
Thank you