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. TCP Protocol Implementation
Forum Updated to NodeBB v4.3 + New Features

TCP Protocol Implementation

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.0k 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.
  • K Offline
    K Offline
    keelerjr12
    wrote on last edited by
    #1

    So I need to send data between a server and client over TCP inside a vehicle. Currently, I have the server up and running but just need to figure out the actual implementation of the data transfer. For the client I need to do the same and figure out how to render the QML correctly. Anyway, what would be a good way to pass data containing QML models or even data such as Artist, Song, and Album (think iPod menu) and then also pass data regarding the song currently playing (song updates like time playing, etc.).

    Any ideas about a good way of implementing a protocol to handle this? Basically the center stack is the server and handles the logic while the cluster/client is just a view that renders QML. I was thinking about just passing QStringLists with model information and then dynamically swapping models within the view. Also, I need to send images over TCP while the song is playing for things like Album art.

    Also, I need an effective way to cache these images and probably the models too, so the client doesn't need to make a request to the server on every menu switch. Again, think about how an iPod works and that's what I'm going for.

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      json or at a push xml over http would seem the obvious way to investigate.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • K Offline
        K Offline
        keelerjr12
        wrote on last edited by
        #3

        Being that http is half-duplex how would the client and server speak back and forth? Basically the client would then just ask for Artist A's tracks and albums or for Album B's tracks and the server would return it as JSON or XML? But the server would never be able to request from the client, right? Which I think in my case, it doesn't need to.

        Also, right now I have an event that fires each second that sends song data to the client. Can this be done over http easily in Qt? I'm going to guess that the answer is yes. Before I started all of this I assumed TCP was the way to go but it seems HTTP might be a better way.

        1 Reply Last reply
        0

        • Login

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