jGuru
Register Email     Password Forgot your
password?
HOME FAQS FORUMS DOWNLOADS ARTICLES PEERSCOPE LEARN

  Search   jGuru Search Help

View:
Networking FAQ Home Page

FAQ Manager is guru Brandon Rohlfs.

The java.net package provides an essential mechanism for implementing network applications. [FAQ Previously managed by Tim Rohaly].

What's New

How do I maintain cookies across separate network connections?
Java:API:Networking
John Zukowski PREMIUM, Jun 30, 2006
Java 5 introduced the abstract CookieHandler class to help with the process, though Java 5 lacks a usable implementation. You must implement yourself....
How do I use Java to ping a host?
Java:API:Networking
John Zukowski PREMIUM, Dec 5, 2005
Starting with Java 5, there is an isReachable() method in the InetAddress class. You can specify either a timeout or the NetworkInterface to use. For more...
How can I encode a URL String?
Java:API:Networking:HTTP
Brandon Rohlfs, Sep 2, 2005
A URL String can be simply encoded using the static encode(String s, String enc) method within the URLEncoder class. encode(String s) has been deprecated...

When using a URLConnection how can I get a specific header field returned by the server or all of them?
Java:API:Networking:HTTP
Brandon Rohlfs, Aug 25, 2005
The URLConnection class contains various methods, which return specific header fields or the whole lot. Specific header fields can be obtained either...
How can I load a class from a remote server?
Java:API:Networking
Brandon Rohlfs, Aug 21, 2005
The URLClassLoader class was created specifically to facilitate the downloading of classes over a network. Three constructors are provided, the first...
While I can certainly show the contents of a web page in a JEditorPane, how do I launch the desktop's browser with the new URL?
Java:API:Networking
John Zukowski PREMIUM, Jul 31, 2005
The JDesktop Integration Components (JDIC), available from https://jdic.dev.java.net, offers support for this: import java.net.*; import org.jde...
How can I parse a URL?
Java:API:Networking:HTTP
Brandon Rohlfs, Jul 24, 2005
The URL class contains a variety of accessor methods, which return the values of a URL's components. URL's use of accesors makes having to parse...
How can I obtain an IP address from a host name?
Java:API:Networking
Brandon Rohlfs, Jun 22, 2005
The InetAddress class gives the programmer a solution to this problem through a process called resolution. When an IP address is obtained from an host...
What is a URL and how can I construct one?
Java:API:Networking
Brandon Rohlfs, Jun 16, 2005
A URL (Uniform Resource Locator) represents a reference to resource on a network. The resource may take many forms. Maybe it is an image stored on a...
How can I access an NNTP newsgroup using JSP or Servlets?
Java:API:Servlets, Java:API:JSP, Java:API:Networking
Alex Chaffee PREMIUM, Dec 4, 2002
Your servlet must know how to speak NNTP, or call a library that does. There are NNTP implementation in the following packages: JavaMail: See...
I'm looking for information on how to write a java program that uses a http url connection object to request data from a servlet... however, I don't want to construct a new tcp/ip connection every time...
Java:API:Networking:HTTP
Krzysztof Raciniewski, Mar 16, 2002
You can set the "http.keepAlive" propety t o true. You can do it running java -Dhttp.keepAlive=true or from code System.getProperties ().put ("http.keepAlive",...
Java application can't estabilish network connection, if the connection came up after application start. First I'm running a the java program below with no network connection. While the program running,...
Java:API:Networking
Karl Logan, Mar 16, 2002
I've found the solution for this problem. If I use the ip address instead of the name of the server then I'm able to reconnect after network break.
HttpUrlConnection headache and the TIMEOUT I have many links(urls) to be checked for their activeness. I want to set a timeout and check whether urls response within the timeout. My final goal...
Java:API:Networking:HTTP
Sean Sullivan, Mar 16, 2002
Instead of using java.net.URLConnection, I recommend that you try the Apache Jakarta HttpClient http://jakarta.apache.org/commons/httpclient/
I am using URLConnection to simulate a browser HTTP POST. However, the website (ebay) claims I cannot accept cookies? I have tried setting the "User-Agent", "Referer" fields etc...What am I doing wrong?...
Java:API:Networking
Stephen Ostermiller PREMIUM, Mar 10, 2002
Cookies are persistant data that the server wants you to store. The cookie is given to you by the server in a header like: Set-Cookie: foo=bar; path=/;...
I want to interrupt an accept()-operation on a ServerSocketChannel with jdk14. But issueing an interrupt() blocks. here is a test program demonstrating this: import java.net.*; import java.nio.*; import...
Java:API:Networking
Simon Ablett PREMIUM, Mar 10, 2002
Interrupting blocked IO operations is dangerous as it could leave the supplier/receiver in an indeterminate state (imagine interrupting a database operation)....
A SocketChannel that has registered with the Selector showing interest in both OP_READ|OP_WRITE I would expect the select() method to continously return showing that the channel isWritable() until the...
Java:API:Networking
Jim Morris, Mar 10, 2002
Actually now I understand how the windows semantics works, due to the way the underlying windows WSAAsyncSelect works.... The FD_WRITE event is handled...
I'm doing this: try { InetAddress address = InetAddress.getLocalHost(); String IP = new String (address.getHostAddress()); } catch (Exception e) { e.printStackTrace(); } on...
Java:API:Networking
Burke Cox, Mar 10, 2002
I've been all over this problem today. It seems to vary across platforms -- and has real trouble working with DHCP. Apparently, the NetworkInterface...
This doubt has been there in my mind regarding socket-port relationship that whether a port is associated with only one unique socket object or multiple socket objects can be associated with a single...
Java:API:Networking
Simon Ablett PREMIUM, Mar 10, 2002
As I understand it, you can have any number of Sockets associated with a host:port combination and only a single ServerSocket. At least this is how it...
In Java, is there any way of getting all the IP addresses associated with a multi-homed system?
Java:Language, Java:API:Networking
Davanum Srinivas PREMIUM, Feb 28, 2002
Support has been added in JDK1.4. import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import...
Here is my question: I have a java serversocket application staying on a windows machine, and listening a certain port say 1111. Can I using other window's application (written in Delphi, for example)...
Java:API:Networking
Simon Ablett PREMIUM, Feb 28, 2002
It shouldn't make a difference what language you write your server/clients in so long as they use TCP/IP sockets. Are you sure that you are not, for example,...
« previous beginning next »


Ask A Question



Related Links

Networking Forum

Java Tutorial Networking Trail

Sun's Networking Features Documentation

Wish List
Features
About jGuru
Contact Us

 




JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
ServerWatch.com Article: Virtualization Enters the SMB World
ITChannelPlanet.com Article: Emerging E-Discovery Market Grows More Vital for VARs
StoreVault Whitepaper: Introduction to Networked Storage
Oracle eBook: Implementing Business Intelligence in Your Organization
Hoovers Sales Tip: Building Credibility with New Clients
SAP Whitepaper: A Corporate Guide to Better Decisions Through IT
Microsoft Article: Flexibility, Agility the Keys to Dynamic IT
Microsoft Article: Improving Infrastructure Management for Mid-Size Companies
IBM Whitepaper: CIO Insights--Ignite Innovation by Fusing Business and IT
IBM Whitepaper: Transforming Legacy Apps into SOA
Internet.com eBook: All About Botnets
Intel Article: 8 Simple Rules for Designing Threaded Applications
Symantec Whitepaper: E-Mail Discovery--Worst-Case Scenarios Versus Best Practices
Ipswitch Whitepaper: Secure File Transfer In the Era of Regulatory Compliance
Symantec Whitepaper: A Unified, Proactive Approach to Endpoint Security
APC eBook: Putting the Green in IT
Intel Whitepaper: Best Practices for Developing and Optimizing Threaded Applications
Symantec Whitepaper: Emerging Trends in Fighting Spam
Oracle eBook: Guide to Oracle 11g and Database Migration
Symantec Whitepaper: Best Practices for IM Archiving & Compliance
Intel Article: The Challenges of Developing Multithreaded Processing Pipelines
Avaya Whitepaper: SIP--Creating Next-Generation Telecom Applications
Avaya Article: Event Processing Demands Real-Time Response for Communications-Enabled Business Apps
MessageLabs Whitepaper: Spam Spikes--A Real Risk to Your Business
Symantec Article: Guarding the Corporate Gateway
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Epicor Webcast: Requirements to Consider When Looking at ITSM Tools
Intel Video: Three Must-Knows for Parallelism
Microsoft: NXT Web Seminar Series
Microsoft Partner Program Video: The Secrets to Partner Success
Rational Asset Manager: Succeed with Asset-based Development
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
NXPowerLite: Desktop Edition Software Trial
IBM Rational Systems Development Solution e-Kit
IBM SOA Development Survival Guide eKit
Evaluate IBM Rational Build Forge Online
IBM Enterprise Architect eKit for SOA
Evaluate Rational Application Developer Online
Iron Speed Designer Application Generator
Symantec IM Detection Utility
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM Overview Video: Next Generation Data Warehousing
IBM Tutorial: Intro to XML User Interface Language (XUL) Development
Microsoft How-to Article: Get Going with Silverlight and Windows Live
IBM Tutorial: The Ajax Transport Method
IBM Tutorial: Learning PHP
IBM Tutorial: Validating XML
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES