Networking Section Index | Page 18
What's a MalformedURLException?
When you try to create a new URL by calling its constructor, it will throw a MalformedURLException if the URL string is not parseable or contains an unsupported protocol.
How do I handle timeouts in my networking applications?
A timeout in a network application happens when a reply
isn't received in a timely manner.
Timeouts usually need to be handled in an application-specific
manner because there is no "right" thing ...more
What is TCP and how does it work?
Internet Protocol, or IP, provides an unreliable packet delivery
system--each packet is an individual, and is handled separately. Packets can
arrive out of order or not at all. The recipient does...more
How can I download files from a URL using HTTP?
One way to do this is by using a URLConnection to open
a stream to your desired URL, then copy the data out of the stream
to a file on your local file system. As an example, here's a little snip...more
How can I make a URL connection through a proxy if the proxy server requires login information (user name, password)?
To have your URLConnection object use a proxy, you will
first need to set some system properties:
Properties properties = System.getProperties();
properties.put("http.proxyHost", "...more
Are there any other FAQs on Jini?
The JINI-USERS mailing list has a FAQ at http://www.artima.com/jini/faq.html. In addition, Sun maintains a FAQ at http://www.sun.com/jini/faqs/.more
How can I obtain a hostname given an IP address?
The code snippet:
String host = InetAddress.getByName("216.217.9.172").getHostName();
should give you the hostname www.jguru.com
How can I obtain the IP address for a given hostname?
The code snippet:
ip =InetAddress.getByName("www.jguru.com").getHostAddress();
should give you the IP address 216.217.9.172
How can I send objects across the network using sockets?
Objects that implement Serializable may be sent across a socket connection using
an ObjectInputStream and ObjectOutputStream combination.
Here are the steps to follow:
First, define an object to ...more
What are RFCs and where can I find them?
RFC stands for "Request for Comment". The
RFCs form an integral part of the Internet
standards; standards are formed
by first publishing a specification as an RFC.
If you wish to implement a s...more
How can I make URL connections through a proxy server?
Java uses two system properties to designate a proxy: http.proxyHost and http.proxyPort.
For applets, these are automatically set to use the browser's settings. However, in an application you need...more
What are good Jini books?
Core Jini is probably the best book currently available for learning how to use Jini. The Jini Specification is also available, but as its name implies it is the specification, and contains only a...more
What mailing lists are available for Jini discussion?
Sun manages the JINI-USERS mailing list. A searchable archive of this list can be found at http://archives.java.sun.com/archives/jini-users.html. There is also a link on that page which lets you ...more
What does time-to-live (TTL) mean?
Time-to-live, or TTL, is an 8-bit unsigned byte that is assigned to each multicast packet. For each route, the TTL value stored in the packet is decremented. When it reaches zero, the packet is ...more
Why use UDP if it is unreliable?
Two reasons: speed and overhead. UDP packets have almost no overhead--you simply send them then forget about them. And they are fast, because there is no acknowledgement required for each pack...more