Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl # # usage: # use warnings; use strict; use IO::Socket; open PIDfile, '>', '/var/run/aws.rcvr.pid'; print PIDfile "$$\n"; close PIDfile; my ($sock, $new_sock, $buf ); $sock = new IO::Socket::INET (LocalHost => '192.168.100.7', LocalPort => 8081, Proto => 'tcp', Listen => 1, Reuse => 1 ); die "Socket could not be created. Reason: $!" unless $sock; while ($new_sock = $sock->accept()) { while (defined ($buf = <$new_sock>)) { if (index($buf, "/DATA_String/") > 0) { system("sh", "/home/app_scripts/process.input", "$buf"); # } else { } } } close ($sock);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Socket buffer errors
by haukex (Archbishop) on Apr 14, 2023 at 21:08 UTC | |
|
Re: Socket buffer errors
by kcott (Archbishop) on Apr 14, 2023 at 22:00 UTC | |
|
Re: Socket buffer errors
by NERDVANA (Priest) on Apr 15, 2023 at 05:44 UTC | |
|
Re: Socket buffer errors
by Marshall (Canon) on Apr 15, 2023 at 16:39 UTC | |
|
Re: Socket buffer errors
by Anonymous Monk on Apr 15, 2023 at 01:09 UTC | |
by kcott (Archbishop) on Apr 15, 2023 at 04:45 UTC |