Results 1 to 4 of 4

Thread: QSocketTCP Is connected

  1. #1
    Join Date
    Dec 2013
    Location
    Jerada, Morroco
    Posts
    106
    Thanks
    11
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QSocketTCP Is connected

    How can we know if QSocketTCP is connected to server TCP or no?

    Thank you in advance

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QSocketTCP Is connected

    If you have called QAbstractSocket::connectToHost() and received a connected() signal (and neither QAbstractSocket::error() nor QAbstractSocket::disconnected() signals) then you are connected.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSocketTCP Is connected

    You can always query the socket state using QAbstractSocket::state().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Dec 2013
    Location
    Jerada, Morroco
    Posts
    106
    Thanks
    11
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QSocketTCP Is connected

    thank you for your answer

Similar Threads

  1. reconnect to server QSocketTCP
    By hassinoss in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2014, 18:09
  2. Replies: 3
    Last Post: 9th September 2013, 01:52
  3. USB connected event using Qt in Linux OS
    By arunkumaraymuo1 in forum Qt Programming
    Replies: 4
    Last Post: 17th April 2013, 15:40
  4. Replies: 6
    Last Post: 8th May 2011, 19:00
  5. Is internet connected
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 24th November 2009, 21:22

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.