GithubHelp home page GithubHelp logo

sharifulin / poe-component-client-icecast Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 128 KB

POE::Component::Client::Icecast - non-blocking client to Icecast server for getting tags

Home Page: http://search.cpan.org/dist/POE-Component-Client-Icecast/

Perl 100.00%

poe-component-client-icecast's Introduction

NAME

POE::Component::Client::Icecast - non-blocking client to Icecast server for getting tags

SYNOPSIS

use strict;
use POE qw(Component::Client::Icecast);
use Data::Dumper;

POE::Component::Client::Icecast->new(
    Stream    => 'http://station20.ru:8000/station-128',
    Reconnect => 10,
    GetTags   => sub {
        warn Dumper $_[ARG0];
    },
);

# or

POE::Component::Client::Icecast->new(
    Host          => 'station20.ru',
    Path          => '/station-128',
    
    RemoteAddress => '87.242.82.108',
    RemotePort    => 8000,
    BindPort      => 8103, # for only one permanent client
    
    Reconnect     => 10,
    
    GetTags       => sub {
        warn Dumper $_[ARG0];
    },
);

POE::Kernel->run;

DESCRIPTION

The module is a non-blocking client to Icecast streaming multimedia server for getting stream tags.

See http://www.icecast.org/.

POE::Component::Client::Icecast is based on POE::Component::Client::TCP.

METHODS

new

POE::Component::Client::Icecast->new(
    Stream        => 'http://station20.ru:8000/station-128',
    
    # or
    
    Host          => 'station20.ru',
    Path          => '/station-128',
    
    RemoteAddress => '87.242.82.108',
    RemotePort    => 8000,
    BindPort      => 8103, # for only one permanent client
    
    # get tags from server
    
    GetTags => sub {
        warn Dumper $_[ARG0];
    },
);

PoCo::Client::Icecast's new method takes a few named parameters:

  • Stream

    The stream url to Icecast stream, which contains domain, port and path to stream. Recommended.

    Instead of this param you ought to use: Host, Path, RemoteAddr and RemotePort.

  • Host

    The host of Icecast server (without port).

  • Path

    The path to Icecast stream.

  • RempoteAddress

    The remote address to connect to Icecast server (host or ip). It's a param of POE::Component::Client::TCP.

  • RemotePort

    The remote port to connect. It's a param of POE::Component::Client::TCP.

  • BindAddress

    The param specifies the local interface address to bind to before starting to connect. It's a param of POE::Component::Client::TCP.

  • BindPort

    The param sets the local socket port that the client will be bound to before starting to connect. It's a param of POE::Component::Client::TCP.

  • GetTags

    The event of getting tags from server, it is called for each fully parsed input record from Icecast server.

    $_[ARG0] contains a hashref of tags.

  • Reconnect

    The flag of reconnect to Icecast server. If this flag exists, client will reconnect to server when an established socket has been disconnected. Delay is value of this param (in seconds). Default value is 0 (no reconnect).

DEBUG & TRACE MODES

The module supports debug mode and trace mode (trace POE session).

BEGIN { $ENV{ICECAST_DEBUG}++; $ENV{ICECAST_TRACE}++ };
use POE::Component::Client::Icecast;

EXAMPLES

See examples/test.pl in this distributive.

SEE ALSO

POE

DEPENDENCIES

POE::Component::Client::TCP POE::Filter::Stream POE::Session Carp

AUTHOR

Anatoly Sharifulin, <sharifulin at gmail.com>

BUGS

Please report any bugs or feature requests to bug-poe-component-client-icecast at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=poe-component-client-icecast. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT & DOCUMENTATION

You can find documentation for this module with the perldoc command.

perldoc POE::Component::Client::Icecast

You can also look for information at:

COPYRIGHT & LICENSE

Copyright (C) 2009-2011 Anatoly Sharifulin

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.