Skip to content
  • 0 Votes
    2 Posts
    666 Views
    J

    Hi, have you been able to find a solution to this issue? i have been wacking my brain around this websocket thing for a few weeks now, and i just cant get it to work, i have fingured out how i can send the data using the Webchannel standalone example and how i can use it to display my sensor data on the web browser. but it doesnt meet the requirements of my project. the problem is the HTML file is basically being opened from the local storage, i want to be able to connect to the html page using a localhost:port option. and the documentation on this is to vague for a neewbi to qt to be able to understand and work with.

    i would really appreciate any help

  • 0 Votes
    2 Posts
    3k Views
    diduD

    I found that the "run" function is called by the new thread.
    But onConnected and onDisconnected are called by the main thread ! (the thread that have created the WebSocketClient instance)

    It looks like I have to review how the signal and slots are connected.
    What is the appropriate way to make the signal stay in the new thread ?

    Edit: Fixed with:

    WebSocketClient mySocket; mySocket->moveToThread(mySocket);

    onConnected and on Disconnected was properly called by the new thread.

  • 0 Votes
    2 Posts
    1k Views
    M

    Does it work in the latest release? Might be that websockets have not been packaged for WinRT in a previous version.

  • 0 Votes
    4 Posts
    3k Views
    A

    Thank you for your advice! I have simplified: I converted the array into a single string