I need to maintain a connection between a server and multiple clients so that clients can send commands and server startup events. The server is basically a music player, and clients send commands like "Play ()", "Pause ()", "GetPlaylists ()", etc. The server on it should be able to tell clients things like "SongEnded" or "PlayerPaused." And also, you need to be able to send some data back and forth (for example, the current song, album, playlists, etc.). I could start creating a socket myself and creating my own protocol for processing all of the above scenarios, but there is a chance that someone has already done this in front of me, so what I really want is a framework created for real-time communication between the server and client for .NET. For example, I looked at xml-rpc, but I donβt know how I should handle "OnClientSend" with this. Also, if I'm not mistaken, xml-rpc is created as REST-like. I also looked at wcf, but since I have no experience with this, I donβt know where to start and how to place the server in a simple console application.
Important: The client must be able to not be .NET.
Important: It should be possible to connect to java (android).
Important: Primary platforms are windows (server and client) and Android (client).
Important: Audio is not streaming. However, images must be sent.
Any ideas for a solution would be appreciated. Also, if you have links to good frameworks or descriptions of how to use components that already exist inside .NET, I would be very happy.
[change] The problem is that when sending data via sockets there is no guarantee (in general!) that the packets you send will be considered a server at the same time. I can send 50, then 100, then 50 bytes, but the server can read this as a 200-byte chunk, or first 100, then 100, etc., Which means I need to create a buffer, read the messages until I I know for sure (this is a problem) that I received the whole message (and nothing more).
source share