Net::OpenSoundControl::Server - OpenSound Control server implementation
use Net::OpenSoundControl::Server; use Data::Dumper qw(Dumper); sub dumpmsg { my ($sender, $message) = @_; print "[$sender] ", Dumper $message; } my $server = Net::OpenSoundControl::Server->new( Port => 7777, Handler => \&dumpmsg) or die "Could not start server: $@\n"; $server->readloop();
This module implements an OSC server (right now, blocking and not-yet multithreaded...) receiving messages via UDP. Once a message is received, the server calls a handler routine. The handler receives the host name of the sender as well as the (decoded) OSC message or bundle.
Creates a new server object. Default port is 7123, default name is Net-OpenSoundControl-Server:7123, default handler is undef.
Net-OpenSoundControl-Server:7123
Returns undef on failure (in this case, $@ is set).
Returns the name of the server
Returns the port the server is listening at
Enters a loop waiting for messages. Once a message is received, the server will call the handler subroutine, if defined.
The OpenSound Control website: http://www.cnmat.berkeley.edu/OpenSoundControl/
Net::OpenSoundControl
Christian Renz, <crenz @ web42.com>
Copyright 2004-2005 by Christian Renz <crenz @ web42.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::OpenSoundControl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::OpenSoundControl
CPAN shell
perl -MCPAN -e shell install Net::OpenSoundControl
For more information on module installation, please visit the detailed CPAN module installation guide.