IO::NonBlocking

Object-oriented interface to non-blocking IO server implementation.
Download

IO::NonBlocking Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Komtanoo Pinpimai
  • Publisher web site:

IO::NonBlocking Tags


IO::NonBlocking Description

Object-oriented interface to non-blocking IO server implementation. IO::NonBlocking is an object-oriented interface to non-blocking IO server implementation.SYNOPSIS package FooServer; use IO::NonBlocking; use strict; use vars qw (@ISA); @ISA=qw(IO::NonBlocking); sub new { my $class=ref($_) || $_; my $self=IO::NonBlocking->new( { server_name => 'FooServer', port => 52721, timeout => 300, piddir => '/tmp' } ); bless $self,$class; } sub onClientConnected { my $self=shift; my $client=shift; print $self->getip($client),":",$self->getport($client)," "; } sub onClientDisconnected { my $self=shift; my $client=shift; print "Disconnected "; } 1; package main; my $obj=FooServer->new; $obj->start;IO::NonBlocking is a non-blocking IO server style, runable on non-blocking IO capable OS -- most Unix and it's cloned platforms.The non-blocking server engine is built, basing on a page of codes of the Tom Christiansen's Perl Classic Cook Book.If you have some experiences with IO::Multiplex, you'll see that the module has poor efficiency. Since IO-multiplexing blocks all clients when one sends his data slowly. At first, I did appreciate the module much, but when user increases, everything is slowed down.After that, I had tried many fruitless improvement to the module and they didn't work at all. I'd realized that there weren't exist such a non-blocking server module on CPAN, after mining for many nights.At last, I did copy my core code from the CookBook and it worked like charm at my first glance, nevertheless the code has some bugs that make my server crash, however, I've fixed it and added many useful features to decide to release it as a module to CPAN. Requirements: · Perl


IO::NonBlocking Related Software