Networking
InetAddress[] ads = InetAddress.getAllByName(hostname);
for (int i=0; i
System.out.println(ads[i]);
}
by Michiel
Q: Hi, I am new to JTapi (java telephony). I am trying to run a sample code provided with
the JTAPI specification. However I get an error message such as :
Can t get Provider:
javax.telephony.JtapiPeerUnavailableException: JtapiPeer: DefaultJtapiPeer could not be
instantiated.
Answer:
As with many Java packages (most notably JDBC) java.telephony is only an API there is
nothing behind it.
You have to pay someone for an implementation.
The point is that if you use the API then it will run with anyone s implementation.
Q: Is there any way to connect through the proxy?
I m connected to the web behind a proxy. When i try to connect to servers outside they time
out and give an exception.
Is there any way to connect through the proxy?
Answer: Try this at the command prompt:
java Dhttp.proxySet=true Dhttp.proxyHost=
Dhttp.proxyPort=
is to be replaced by the proxy host.
is to be replaced by a proxy port number (i.e. 8080)
is the java class that you are running.
You can also set these function through the System class. Check the API for setting
properties.
Hope that works.
Dan
Q: Socket My problem is the main class that spawned these threads cannot kill the
thread if it s blocked in a read.
I m making a program that launches some threads that connect to the net and do some stuff.
I m using a blocking read (TCP/IP BufferedReader.readLine) because I ve been
recommended by a few people that it was the better way to do it.
My problem is the main class that spawned these threads cannot kill the thread if it s blocked
in a read.
Is there a thread function I could use? I tried use BufferedReader.ready() to make my read not
blocking
(BufferedReader.ready() returns true only if the the stream is readable otherwise loop so there
is no actual blocking) but my problem with that was that BufferedReader.ready() doesn t throw
an exception if the other side disconnects so I m left looping infinitely. I m really stuck here so
file:///F|/a_jsite/350_tips/networking.htm (3 of 4) [2001 07 08 11:24:57]
footer
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved