forked from alranel/Net-LDAP-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Net::Server and distinct input and output filehandles (pa…
…tch by Alexei Znamensky)
- Loading branch information
Showing
4 changed files
with
76 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
package Listener; | ||
use Net::Server; | ||
use base 'Net::Server::Fork'; | ||
use MyDemoServer; | ||
#use Data::Dumper; | ||
#use Scalar::Util qw/openhandle/; | ||
|
||
sub process_request { | ||
my $self = shift; | ||
|
||
my $in = *STDIN{IO}; | ||
my $out = *STDOUT{IO}; | ||
|
||
my $sock = $self->{server}->{client}; | ||
#print STDERR "Accepted connection from: %s\n", Dumper($sock->connected() ); | ||
#printf STDERR "Accepted connection from: %s\n", join '.', unpack( 'C4', $sock->connected() ); | ||
|
||
#print STDERR 'in = ('.openhandle($in).') '.Dumper($in); | ||
#print STDERR 'out = ('.openhandle($out).') '.Dumper($out); | ||
my $handler = MyDemoServer->new($sock); | ||
#my $handler = MyDemoServer->new($in,$out); | ||
while (1) { | ||
my $finished = $handler->handle; | ||
return if $finished; | ||
} | ||
} | ||
|
||
package main; | ||
Listener->run(port => 8080); | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters