Hello,
Welcome to our Microsoft Q&A platform!
Do you use TcpClient
to make connection? If so, if the TCP is disconnects, you want to re-connect it, A TcpClient instance can only be used to connect once. You can simply instantiate a new TcpClient, rather than trying to re-open a closed one.
client.Close();
client = new TcpClient();
client.Connect(host, port);
Also I have a second problem, the media server communicates the progress of a song (seconds) to me via an API Rest call. IN the moment a song is playing I should >make a call per second to get back the seconds of progress
You can get the length of Audio(seconds of audio), then decrease this seconds when you play it.
If you want to play the online audio, you can try to use MediaManager
to achieve it, it provides the control to show the audio's progress.
Designed to be simple and easy to use
Native playback of media files from remote http(s), embedded and local sources
Native media notifications and remote controls
Queue and playback management by default
Playback status (Playing, Buffering, Loading, Paused, Progress)
Events for media handling to hook into
https://github.com/Baseflow/XamarinMediaManager
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.