NAME

Net::RTP - Send and recieve RTP packets (RFC3550)

SYNOPSIS

use Net::RTP;

my $rtp = new Net::RTP( LocalPort=>5170, LocalAddr=>'233.122.227.171' );
$rtp->mcast_add('233.122.227.171');

my $packet = $rtp->recv();
print "Payload type: ".$packet->payload_type()."\n";

DESCRIPTION

The Net::RTP module subclasses IO::Socket::Multicast to enable you to manipulate multicast groups. The multicast additions are optional, so you may also send and recieve unicast packets.

$rtp = new Net::RTP( [LocalPort=>$port,...] )

The new() method is the constructor for the Net::RTP class. It takes the same arguments as IO::Socket::Multicast and IO::Socket::INET. As with IO::Socket::Multicast the Proto argument defaults to "udp", which is more appropriate for RTP.

To create a UDP socket suitable for sending outgoing RTP packets, call new() without no arguments. To create a UDP socket that can also receive incoming RTP packets on a specific port, call new() with the LocalPort argument.

If you plan to run the client and server on the same machine, you may wish to set the IO::Socket ReuseAddr argument to a true value. This allows multiple multicast sockets to bind to the same address.

my $packet = $rtp->recv( [$size] )

Blocks and waits for an RTP packet to arrive on the UDP socket. The read $size defaults to 2048 which is usually big enough to read an entire RTP packet (as it is advisable that packets are less than the Ethernet MTU).

Returns a Net::RTP::Packet object or undef if there is a problem.

$rtp->send( $packet )

Send a Net::RTP::Packet from out of the RTP socket. The PeerPort and PeerAddr should be defined in order to send packets. Returns the number of bytes sent, or the undefined value if there is an error.

SEE ALSO

Net::RTP::Packet

IO::Socket::Multicast

IO::Socket::INET

http://www.ietf.org/rfc/rfc3550.txt

BUGS

Please report any bugs or feature requests to bug-net-rtp@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you will automatically be notified of progress on your bug as I make changes.

AUTHOR

Nicholas J Humfrey, njh@cpan.org

COPYRIGHT AND LICENSE

Copyright (C) 2006 University of Southampton

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.005 or, at your option, any later version of Perl 5 you may have available.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 141:

You forgot a '=back' before '=head1'