Results 1 to 5 of 5

Thread: Client QNetworkReply is returning Connection Closed Status

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Client QNetworkReply is returning Connection Closed Status

    Well, you are using QNetworkAccessManager on a HTTP URL.
    But your server does not respond with an HTTP response, but with just a string.

    It is very likely that the HTTP handler on the client aborts the connection when it gets this unexpected and (for HTTP) invalid data.

    Hence the suggestion to try sending a valid response and see if that fixed the problems you are observing.

    Cheers,
    _

  2. #2
    Join Date
    Apr 2014
    Posts
    125
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default Re: Client QNetworkReply is returning Connection Closed Status

    Thanks for the reply. You are absolutely right, sending a valid HTTP reply is fixing the problem. Ex:

    /* Respond with a basic HTTP message. */
    client->write("HTTP/1.1 200 OK\r\n"
    "Content-type: text/plain\r\n"
    "Content-length: 12\r\n"
    "\r\n"
    "Hello World!");

Similar Threads

  1. Replies: 14
    Last Post: 1st June 2015, 09:15
  2. Replies: 5
    Last Post: 29th March 2015, 21:31
  3. client & server connection -Beginer
    By sathees in forum Newbie
    Replies: 1
    Last Post: 11th May 2014, 12:00
  4. Replies: 6
    Last Post: 2nd April 2014, 09:57
  5. How do I keep the client connection open ?
    By probine in forum Newbie
    Replies: 2
    Last Post: 25th March 2006, 19:06

Tags for this Thread

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.