Forums Register Login

How to call a service that this in a door of a server?

+Pie Number of slices to send: Send
Which library in java that I get to call a service that this in a door of a server?

Service: ListAgent
Server: 172.10.20.203
Port: 49500

Example: In PERL a package that I manage to do that exists

service.pl
...
if (! ($remote =
IO::Socket::INET->new (PeerAddr => $server,
PeerPort => $port,
Proto => 'tcp')))
{
push(@return, "Error.... <br> ;
}
else {
#parameters are being passed for the
# service to execute
print $remote "$validate|$who|$command\n";
while(<$remote> {
push(@return,$_) if($_);
}
}

How well to call this same service in java?
Thank you
+Pie Number of slices to send: Send
My first thought is that you are going to have to open a Socket to get to that Server.
Let's move this to the Socket Forum and see what they have to say.
[ December 16, 2002: Message edited by: Cindy Glass ]
+Pie Number of slices to send: Send
Here's a rough idea how to do the same thing in Java:

I omitted all the exception handling; you should do so as any civil program should.
As you will see, the Java counterpart is about more the 50% bigger, which leads me to ask:
BTW, I am just curious why you would go with a Java solution over Perl?
Here is a wonderful tutorial
You should also read all about the java.net package.
[ December 16, 2002: Message edited by: Leslie Chaim ]
It was the best of times. It was the worst of times. It was a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 925 times.
Similar Threads
How to call a service that this in a door of a server?
Check Socket Connection State
Calling Perl procedures using Java remotely
Socket on server side
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:06:46.