⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Cross Platform client for SocketIO (nodejs socketio backend)

  • Hello! Sorry if I'm writing on the wrong place, this is my first topic here. I am developing a QT application that I want to be cross platform (windows, linux and android at least) and that uses socketIO, without much hassle. Ive tried this: https://github.com/socketio/socket.io-client-cpp.

    The problem is that this library simply cant be compiled to android, since it relies on so many dependencies including boost and uses cmake, i could compile boost with the android ndk but not this library, if anyone knows how to build that for android then my problem is solved.

    My other option was https://github.com/KurtPattyn/QtSocketIo, but it is too outdated and doesnt support socketIO 1.x. It has a fork that is newer but i couldnt figure out how to use it.

    Since my aplication uses QML, I've tried importing the socketIO js, also didnt work, same as what happens here: https://stackoverflow.com/questions/36852994/how-can-i-integrate-javascript-library-socketio-in-qml .

    So what am I left with? Changing the backend is not an option since theres also a java and a html clients working for it. I was wondering if i could use QwebKit to somehow make bindings with the client sockeio.js. Is that possible? Ive also tried communicanting with the socketIO server forcing the use of websockets, which wouldnt be a problem, by adding socket.io/?EIO=3&transport=websocket to the url. The problem is that the connection breaks many times and i coudlnt quite receieve socketIO messages with this.

    Anyway, my question is: Is there any good way to use socketIO on QT and keep it cross platform, specially android compatible? Thanks!

Log in to reply