[Denver-pm] OT: Java network connection test?
Larry Leszczynski
larryl at emailplus.org
Tue Jun 30 16:36:43 PDT 2015
On Tue, Jun 30, 2015, at 05:22 PM, Larry Leszczynski wrote:
> On Tue, Jun 30, 2015, at 04:35 PM, Robert L. Harris wrote:
> > I'm trying to solve a side issue at work on an Android. Just started
> > learning Java since there's no Perl to effectively just do a small
> > network connection to test if a service is available.
>
> How about something like:
>
> -----------------------------
> use IO::Socket::INET;
>
> my $socket = new IO::Socket::INET (
More properly:
my $socket = IO::Socket::INET->new(
> PeerHost => '127.0.0.1',
> PeerPort => '5000',
> Proto => 'tcp',
> ) or die "ERROR in Socket Creation : $!\n";
>
> print "TCP Connection Success.\n";
> -----------------------------
More information about the Denver-pm
mailing list