Results 1 to 3 of 3

Thread: QT3 - detecting peer

  1. #1
    Join Date
    Oct 2009
    Posts
    2
    Qt products
    Qt3

    Unhappy QT3 - detecting peer

    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

  2. #2
    Join Date
    Oct 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QT3 - detecting peer

    QTcpSocket communication achieved through signals and slots. The client has to communication with the server to connect to it. I suggest looking at some of the network examples that come with Qt http://qt.nokia.com/doc/4.5/examples.html#network

  3. #3
    Join Date
    Oct 2009
    Posts
    2
    Qt products
    Qt3

    Default Re: QT3 - detecting peer

    I am using qt 3. I have no Qtcpsocket.

Similar Threads

  1. Detecting changes in the qwt plot axis
    By mrcolin in forum Qwt
    Replies: 2
    Last Post: 27th January 2009, 13:53
  2. qmake: detecting x86_64 architecture?
    By akos.maroy in forum Qt Programming
    Replies: 3
    Last Post: 2nd August 2008, 12:26
  3. Detecting low memory
    By steg90 in forum General Programming
    Replies: 3
    Last Post: 11th June 2007, 19:54
  4. Usb Peer To Peer
    By locus in forum General Programming
    Replies: 1
    Last Post: 6th February 2007, 22:41
  5. Detecting a action ( undo/ redo)
    By ankurjain in forum Qt Programming
    Replies: 2
    Last Post: 5th May 2006, 06:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.