| 424 | } |
| 425 | |
| 426 | void Help(string program) |
| 427 | { |
| 428 | Usage(program); |
| 429 | cerr << endl; |
| 430 | cerr << |
| 431 | "SIPLEX is a program that demonstrates two SRT features:\n" |
| 432 | " - using one UDP outgoing port for multiple connecting SRT sockets\n" |
| 433 | " - setting a resource ID on a socket visible on the listener side\n" |
| 434 | "\n" |
| 435 | "The <SRT URI> will be input or output depending on the further -i/-o option.\n" |
| 436 | "The URIs specified as -i INPUT... will be used for input and therefore SRT for output,\n" |
| 437 | "and in the other way around if you use -o OUTPUT...\n" |
| 438 | "For every such URI you must specify additionally a parameter named 'id', which will be\n" |
| 439 | "interpreted by the application and used to set resource id on an SRT socket when connecting\n" |
| 440 | "or to match with the id extracted from the accepted socket of incoming connection.\n" |
| 441 | "Example:\n" |
| 442 | "\tSender: srt-multiplex srt://remhost:2000 -i udp://:5000?id=low udp://:6000?id=high\n" |
| 443 | "\tReceiver: srt-multiplex srt://:2000 -o output-high.ts?id=high output-low.ts?id=low\n" |
| 444 | "\nHere you create a Sender which will connect to 'remhost' port 2000 using multiple SRT\n" |
| 445 | "sockets, all of which will be using the same outgoing port. Here the port is autoselected\n" |
| 446 | "by the first socket when connecting, every next one will reuse that port. Alternatively you\n" |
| 447 | "can enforce the outgoing port using 'port' parameter in the SRT URI.\n\n" |
| 448 | "Then for every input resource a separate connection is made and appropriate resource id\n" |
| 449 | "will be set to particular socket assigned to that resource according to the 'id' parameter.\n" |
| 450 | "When the listener side (here Receiver) gets the socket accepted, it will have the resource\n" |
| 451 | "id set just as the caller side did, in which case srt-multiplex will search for this id among\n" |
| 452 | "the registered resources and match the resource (output here) with this id. If the resource is\n" |
| 453 | "not found, the connection is closed immediately. This works the same way regardless of which\n" |
| 454 | "direction is used by caller or listener\n"; |
| 455 | |
| 456 | } |
| 457 | |
| 458 | int main( int argc, char** argv ) |
| 459 | { |