source: ntrip/trunk/BNC/test_tcpip_client.pl@ 3837

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