Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1072181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:49:13+00:00 2026-05-16T20:49:13+00:00

I need to maintain a connection between a server and multiple clients so that

  • 0

I need to maintain a connection between a server and multiple clients so that the clients can send commands, and the server trigger events. The server is basically a music-player, and the clients send commands like “Play()”, “Pause()”, “GetPlaylists()”, etc. The server on it’s side need to be able to tell the clients things like “SongEnded” or “PlayerPaused”. And also, it needs to be possible to send some data to and forth (like current song, album image, playlists, etc.). I could of cause go ahead and create a socket myself and create my own protocol for handling all of the above scenarios, but chances are that someone has already done this before me, so what I really want is a framework made for real-time-communication between server and client for .NET. I’ve looked at xml-rpc for instance, but not sure how I should handle the “OnClientSend” with that. Also, if I’m not mistaken, xml-rpc is made to be REST-like. I’ve also looked at wcf, but since I have no experience with it I don’t know where to start, and how to host the server in a simple console-app.

Important: The client needs to be able to not be .NET.
Important: This needs to be possible to connect to java (android).
Important: Primary platforms are windows (server and client), and Android (client).
Important: No streaming of audio is made. However, images needs to be sent.

Any ideas for a solution would be appreciated. Also, if you got links to a good framework, or descriptions of how to use components already existing inside .NET I’d be really happy.

[Edit]
The problem is that when sending data over sockets there is no guarantee (at all!) that the packages you sent will be read by the server at the same time. I might send 50, then 100, then 50 bytes again, but the server might read that as a 200byte chunk, or first 100 then 100 etc, which means I need to create a buffer, read in messages until I know for certain (this is the problem) that I’ve received a whole message (and nothing more).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:49:13+00:00Added an answer on May 16, 2026 at 8:49 pm

    I ended up creating my own simple protocol that I easily can implement in several languages. I achieved the wanted result by adding an extra layer of buffers on both sides of the socket, then sending each message followed by a byte-sequence that tells the other side that this was the end of the message. Also I added id’s to the message to enable the spesial “$Return” message.

    The messages are simply serialized classes using xmlserializer. Classes are generated from xsd.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two Tomcat servers that need to maintain a persistent connection to cut
I need to maintain a roster of connected clients that are very shortlived and
There is a project that I need to maintain that talks to mysql via
We have an Excel application that I need to maintain that has shown his
I was advised in a previous question that I didn't need to maintain the
I need to print XML that I manipulated using groovy and maintain the attribute
Goal: Remote control ssh server with one connection and multiple sessions or one persistent
I need to write a server which accepts connections from multiple client machines, maintains
I have to maintain transactions between two different databases. I need to rollback if
Have a use case wherein need to maintain a connection open to a database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.