Author Topic: Execution of bridge commands stuck under some conditions  (Read 1285 times)

m1k6

  • Newbie
  • *
  • Posts: 12
  • Hello!
Hello,
I've noticed the following.
The setup:
There is a bridge with a virtual port, linked to an encoder.

It looks like the execution of the commands sent via the virtual port are stuck, if Magic RDS is not able to respond to at least one connected client (e.g. if the client just connects, sends it's message and immediately disconnects).

For example, this PHP script communicates with the virtual port. For example, to simply send "TA=0" and "TA=1".
Code: [Select]

$rdsmessage = "TA=1";
$fp = fsockopen('127.0.0.1', 10001, $errno, $errstr, 5);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    fwrite($fp, $rdsmessage . "\r\n");
    //usleep(100000); //100ms
    fclose($fp);
}
Without the "usleep"-line, Magic RDS does not react to the message sent. If the line is uncommented, thus the PHP-script waits some time before closing the connection, Magic RDS reacts.
Magic RDS will also react if a new connection is opened or there is still at least one other active connection.

I noticed the same behaviour with a popular playout-software which offers TCP-logging of song information. There, the software also doesn't care about the response, just sends the message and disconnects immediately.

Best regards

Jan

  • Hero Member
  • *****
  • Posts: 1092
Re: Execution of bridge commands stuck under some conditions
« Reply #1 on: June 04, 2024, 06:46:14 pm »
You're true. The TCP server uses polling for reading data from the socket. Only data from existing connections is processed. If the client disconnect before the data is read from the socket, the data is lost. A solution is on the way.

Jan

  • Hero Member
  • *****
  • Posts: 1092
Re: Execution of bridge commands stuck under some conditions
« Reply #2 on: June 06, 2024, 10:38:33 pm »
It seems to be fixed in today's build:
https://pira.cz/rds/magicrds/MagicRDS_Setup.exe

If the problem remains, please let me know.