Results 1 to 2 of 2

Thread: how to properly close and delete a websocket?

  1. #1
    Join Date
    Oct 2017
    Posts
    3
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default how to properly close and delete a websocket?

    my app uses websocket, i want to close it and delete the websocket when it is not needed. what should i do?
    i looked at the echo examples, only found it doesnt close and delete the socket object, exits to system directly.

    thanks in advance.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: how to properly close and delete a websocket?

    Quote Originally Posted by Qt Documentation
    QWebSocket::~QWebSocket()

    Destroys the QWebSocket. Closes the socket if it is still open, and releases any used resources.
    Just delete it
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. Qt application doesn't close properly during QEventloop
    By jigglyslime in forum Qt Programming
    Replies: 9
    Last Post: 6th November 2013, 09:03
  2. How to close (exit) a dialog properly
    By cooper in forum Newbie
    Replies: 6
    Last Post: 9th March 2011, 19:19
  3. Properly close database handlers
    By ruben.rodrigues in forum Newbie
    Replies: 5
    Last Post: 23rd September 2010, 16:10
  4. Delete/Close Dialog correct?
    By kei in forum Qt Programming
    Replies: 8
    Last Post: 2nd July 2009, 13:51
  5. How to properly delete structures?
    By aarelovich in forum General Programming
    Replies: 5
    Last Post: 24th February 2009, 00:39

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.