Last change
on this file since 1386 was 643, checked in by weber, 17 years ago |
* empty log message *
|
-
Property svn:executable
set to
*
|
File size:
685 bytes
|
Rev | Line | |
---|
[643] | 1 | #!/usr/local/bin/perl -w
|
---|
| 2 |
|
---|
| 3 | use strict;
|
---|
| 4 | use IO::Socket;
|
---|
| 5 |
|
---|
| 6 | # List of Parameters
|
---|
| 7 | # ------------------
|
---|
| 8 | my($port) = @ARGV;
|
---|
| 9 |
|
---|
| 10 | if (!defined($port)) {
|
---|
| 11 | die "Usage: test_bnc_eph.pl portNumber\n";
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | # Local Variables
|
---|
| 15 | # ---------------
|
---|
| 16 | my($serverHostName) = "localhost";
|
---|
| 17 | my $server;
|
---|
| 18 |
|
---|
| 19 | my $retries = 10;
|
---|
| 20 | while ($retries--) {
|
---|
| 21 | $server = IO::Socket::INET->new( Proto => "tcp",
|
---|
| 22 | PeerAddr => $serverHostName,
|
---|
| 23 | PeerPort => $port);
|
---|
| 24 | last if ($server);
|
---|
| 25 | }
|
---|
| 26 | die "Cannot connect to $serverHostName on $port: $!" unless ($server);
|
---|
| 27 |
|
---|
| 28 | my $buffer;
|
---|
| 29 | while (defined ($buffer = <$server>)) {
|
---|
| 30 | print $buffer;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.