PDA

View Full Version : qml Websockets



Ini
3rd March 2017, 23:11
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-qmlwebsocketserver-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

anda_skoa
4th March 2017, 13:07
Wouldn't it make more sense to ask this on a forum for whatever server side technology you are using?

Cheers,
_

Ini
4th March 2017, 13:28
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?

anda_skoa
5th March 2017, 09:49
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,
_

Ini
5th March 2017, 14:40
I will but how do I open the connection?

ws://......exe

like this?

anda_skoa
6th March 2017, 08:03
Why would the URL end in "exe"?

A network connection is to a host, or more preciselyl to a address:port 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,
_