Page 1 of 1

Socket Interface to RC

Posted: 14 Aug 2009 23:54
by tcc
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

Re: Socket Interface to RC

Posted: 25 Aug 2009 23:33
by tcc
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