Socket Interface to RC

This forum is about all development around libVLC.
tcc
Blank Cone
Blank Cone
Posts: 93
Joined: 24 Feb 2009 03:41

Socket Interface to RC

Postby tcc » 14 Aug 2009 23:54

Hi,

I'm having some trouble sending rc commands to VLC using a socket connection. My simple test is to send "stop" followed by "play" from a test app on PC1 to VLC on PC2.

What I'm seeing is that the "stop" command is processed by VLC on PC2 but the "play" command is not.

I'm using synchronus socket connection, Windows OS. Something like this:

socket.Connect(hostEndPoint);
socket.Send("stop\r\n");
socket.Send("play\r\n"):
socket.Close();

Can rc interface accept multiple commands sent in sequence like this or is there some sort of 2-way communication that has to occur after each command, or some type of wait period?

Regards,
tcc

tcc
Blank Cone
Blank Cone
Posts: 93
Joined: 24 Feb 2009 03:41

Re: Socket Interface to RC

Postby tcc » 25 Aug 2009 23:33

Belatedly, a note of thanks to Rémi Denis-Courmont for some helpful advice via VideoLAN IRC channel.

So as it turns out, commands cannot simply be stacked up and sent to RC. The sender must always dequeue responses coming back from RC. A relativly simple implementation using blocking (synchronus) socket connection works quite well. Just pseudocode below...

socket.Connect(hostEndPoint);
socket.Send("stop\r\n");
socket.Receive(hostEndPoint, rvcBfr);
socket.Send("play\r\n"):
socket.Receive(hostEndPoint, rvcBfr);
socket.Close();

Regards,
tcc


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 58 guests