Permalink
Browse files

Use LSFServer

  • Loading branch information...
1 parent db89962 commit 921c25d8c6909b6832a951b839623d44d20ffea9 @athomason committed Apr 8, 2011
Showing with 2 additions and 67 deletions.
  1. +2 −67 t/07-Log-Syslog-Fast-PP.t
View
@@ -9,6 +9,8 @@ use IO::Socket::UNIX;
use Log::Syslog::Constants ':all';
use POSIX 'strftime';
+require 't/lib/LSFServer.pm';
+
use Log::Syslog::Fast::PP ':protos';
my $test_dir = tempdir(CLEANUP => 1);
@@ -240,71 +242,4 @@ sub wait_for_readable {
return IO::Select->new($sock)->can_read(1);
}
-package ServerCreator;
-
-sub new {
- my $class = shift;
- return bless {label => $_[0], listen => $_[1]}, $class;
-}
-
-
-sub listen {
- my $self = shift;
- $self->{listen}->();
-}
-
-package Server;
-
-sub new {
- my $class = shift;
- return bless {@_}, $class;
-}
-sub proto {
- my $self = shift;
- return $self->{proto};
-}
-
-sub address {
- my $self = shift;
- return @{ $self->{address} };
-}
-
-sub connect {
- my $self = shift;
- return Log::Syslog::Fast::PP->new($self->proto, $self->address, @_);
-}
-
-sub close {
- my $self = shift;
- $self->{listener} = undef;
-}
-
-# remove unix socket file on server close
-sub DESTROY {
- my $self = shift;
- if ($self->{address}[1] == 0) {
- unlink $self->{address}[0];
- }
-}
-
-package StreamServer;
-
-use base 'Server';
-
-sub accept {
- my $self = shift;
- my $receiver = $self->{listener}->accept;
- $receiver->blocking(0);
- return $receiver;
-}
-
-package DgramServer;
-
-use base 'Server';
-
-sub accept {
- my $self = shift;
- return $self->{listener};
-}
-
# vim: filetype=perl

0 comments on commit 921c25d

Please sign in to comment.