Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is it possible to to create a server with several endpoints by QWebSocketServer?
Forum Updated to NodeBB v4.3 + New Features

Is it possible to to create a server with several endpoints by QWebSocketServer?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 424 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • thamT Offline
    thamT Offline
    tham
    wrote on last edited by tham
    #1

    Could I use QWebSocketServer to "register" different endpoints like

    Examples

    ws://some_address/update_image
    ws://some_address/download_image
    ws://some_address/car_monitor

    etc.

    I have wrote a simple application by QWevSocketServer, but have no idea how could I add more endpoints to it. If there is no way or hard to be done by QWebSocketServer, I will add a "mode" field in my json file in order to process different tasks. Thank you very much.

    A 1 Reply Last reply
    0
    • thamT tham

      Could I use QWebSocketServer to "register" different endpoints like

      Examples

      ws://some_address/update_image
      ws://some_address/download_image
      ws://some_address/car_monitor

      etc.

      I have wrote a simple application by QWevSocketServer, but have no idea how could I add more endpoints to it. If there is no way or hard to be done by QWebSocketServer, I will add a "mode" field in my json file in order to process different tasks. Thank you very much.

      A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      @tham Sure. But not like you would think. Basically once you accept the connection to the websocket, you can then get the URL with something like sock->requestUrl() and then act accordingly based on the URL you received.

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      4

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved