Results 1 to 6 of 6

Thread: qml Websockets

  1. #1
    Join Date
    Nov 2015
    Posts
    67

    Default qml Websockets

    Hello,

    I have experience with Qt, php and Ajax, but I'm new to Websockets. I have no idea how to setup a server with this example from Qt: http://doc.qt.io/qt-5/qtwebsockets-q...r-example.html

    How do I implement this lets say on my XAMPP Server? I have no commercial license, I guess I need to make a standalone exe or something out of it right?

    The documentation of this class is not very helpful for beginners. I hope you can help me and I hope it's not to complicated. Please help.

    Thank you

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

    Default Re: qml Websockets

    Wouldn't it make more sense to ask this on a forum for whatever server side technology you are using?

    Cheers,
    _

  3. #3
    Join Date
    Nov 2015
    Posts
    67

    Default Re: qml Websockets

    I want to use Qt/C++. I thought this code can be used for that. I mean what is it for when it cannot be used for that? Is it there to explain in theory how a websocket works?

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

    Default Re: qml Websockets

    Ok, that wasn't clear from your original posting.

    Probably don't want to use QtQuick though, either just the QML API for web sockets or C++, unless you want a GUI program on your server.
    Maybe have a look at the echo server example for the usage from C++?

    Cheers,
    _

  5. #5
    Join Date
    Nov 2015
    Posts
    67

    Default Re: qml Websockets

    I will but how do I open the connection?

    ws://......exe

    like this?

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

    Default Re: qml Websockets

    Why would the URL end in "exe"?

    A network connection is to a host, or more preciselyl to a addressort tuple.

    The port can be optional if there is a well known value, e.g. HTTP URLs don't usually specify port 80, but they could.

    Have you actually run the examples?
    With the server and client running on the same system and using "localhost" as the URL's hostname part?

    Cheers,
    _

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.