0

I have a GUI application which contains a websocket server QWebSocketServer. I also have a python script which sends messages and the application processes them. Everything works well. During testing I wanted to run the application in headless mode using -platform offscreen command line argument added to the app executable name (I changed nothing else). But the problem is that when the application runs off-screen, the client script cannot establish connection with the web socket server. I tested this on localhost only. I do not understand how this two things, visibility of GUI and websockets, can interfere. Any ideas what could go wrong?

Note: I am using Qt 5.11.1 64-bit with VS 2017 on Windows 10 Pro.

  • I further exploring the issue. I tried the same with another application and it seems to work well even for `-platform offscreen`. I have no idea what difference in the application code caused this. – HiFile.app - best file manager Jul 01 '18 at 11:38

1 Answers1

1

A platform plugin is a bit more than merely "GUI". The -platform option selects a family of platform-specific plugins. Perhaps some plugins that make networking work are absent on that platform spec. That's very likely, since the offscreen platform is only a proof-of-concept: it's to show how you'd write a platform plugin. It's example code, and it does the bare minimum needed. It's nothing that you should be using for production without fully understanding what's there and how it works - it wasn't not meant for it, at least not the last time I looked at it. It shouldn't be hard to make it work, but you'd need to clone the source and start hacking on it.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313