Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Create connection to theserver and send requests

Posted on 2005-03-23
Medium Priority
Last Modified: 2008-03-03
I need to do implement simple rtsp requests

1. Create connection to the server (
2. send "Describe" request
                DESCRIBE rtsp:// RTSP/1.0
2. send "Setup" request
                SETUP rtsp:// RTSP/1.0
2. send "Play" request
                PLAY rtsp:// RTSP/1.0

How can I do this in simple way ,if it possible ,
Question by:Inga_dusha
LVL 85

Accepted Solution

ozo earned 400 total points
ID: 13609760
use IO::Socket::INET;
use strict;
my $socket = IO::Socket::INET->new( '') or die "Can't create socket $!";
print $socket "DESCRIBE rtsp:// RTSP/1.0\n";
print $socket "SETUP rtsp:// RTSP/1.0\n";
print $socket "PLAY rtsp:// RTSP/1.0\n";


Author Comment

ID: 13609840
to manav_mathur  ,

I know about this module ,but I didn't understand how it works ,
no example ,and I tryed some requests ,it didn'w work .
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 13619964

maybe you know ,after I send this commands ,
my client close the connection .I see this in Ethereal (FIN,ACK) ,and doesn't wait for the answer.

How can I make to my program wait for the anser and not close the the connection  

Thanks for help.
LVL 18

Expert Comment

ID: 13626044
Net::RTSP looks like a good implementation of the protocol, and I doubt it will be easier to rewrite it yourself.
I do agree, however, that the documentation is severely lacking. Then again, it's only version 0.20.

In any case, it looks like it should get you started fairly quickly.

    # untested code

    $rtsp = new Net::RTSP(Interface => 'Procedural');
    # $presentation is a Net::RTSP::Presentation object
    $presentation = $rtsp->initialize('rtsp://');

    # send describe request
    $desc = $presentation->describe;

    # $desc is a RTSP::Response object
    # just showing you some of the methods
    print $desc->code, $desc->description, $desc->content if $desc->is_ok;

    # $session is a Net::RTSP::Session object
    # this sends a setup request
    $session = $presentation->setup_session;

    # send play request
    # returns another RTSP::Response object
    $play = $session->play;

    # or
    # $record = $session->record;

Author Comment

ID: 13630165
to kandura

this module doesn't work ,I tryed a lot of times ,

what I need is to continue listen and not close the connection ,how can I make it ?
LVL 18

Expert Comment

ID: 13632070
use IO::Socket::INET;
use strict;
my $socket = IO::Socket::INET->new( '') or die "Can't create socket $!";
print $socket "DESCRIBE rtsp:// RTSP/1.0\n";
print $socket->getlines();

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question