Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use warnings;
- #use strict;
- use IO::Socket::INET;
- use IO::Select;
- $| = 1;
- $socket = new IO::Socket::INET (
- LocalHost => '0.0.0.0',
- LocalPort => '4005',
- Proto => 'tcp',
- Listen => 100,
- Reuse => 1
- ) or die "ERROR in Socket Creation : $!\n";
- $select = IO::Select->new($socket) or die "IO::Select $!";
- while(1) {
- @ready_clients = $select->can_read(1);
- foreach my $fh (@ready_clients) {
- if($fh == $socket) {
- my $new = $socket->accept();
- $select->add($new);
- } else {
- my $data=<$fh>;
- if(!$data) {
- print "DISCON\n";
- $fh->close;
- }
- if($data && $data =~ /lobcount/) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement