|
Network Streams
From its first days, Java has had the network in mind, more so than any other common programming language. Java is the first programming language to provide as much support for network I/O as it does for file I/O, perhaps even more--Java's URL, URLConnection, Socket, and ServerSocket classes are all fertile sources of streams. The exact type of the stream used by a network connection is typically hidden inside the undocumented sun classes. Thus, network I/O relies primarily on the basic InputStream and OutputStream methods, which you can wrap with any higher-level stream that suits your needs: buffering, cryptography, compression, or whatever your application requires.
|
|
Sockets for Servers
The last chapter discussed sockets from the standpoint of clients: programs that open a socket to a server that's listening for connections. However, client sockets themselves aren't enough; clients aren't much use unless they can talk to a server, and if you think about it, the sockets we discussed in the last chapter aren't sufficient for writing servers. To create a Socket, you need to know the Internet host to which you want to connect
|
|
All About Sockets
URLs and URLConnections provide a relatively high-level mechanism for accessing resources on the Internet. Sometimes your programs require lower-level network communication, for example, when you want to write a client-server application.
|
|
Custom Networking
The Java platform is highly regarded in part because of its suitability for writing programs that use and interact with the resources on the Internet and the World Wide Web. In fact, Java-compatible browsers use this ability of the Java platform to the extreme to transport and run applets over the Internet.
|
|
Client-Server Programming With Java Sockets
You might wonder why you might choose to use sockets to communicate with remote objects when RMI is availble
|
|
Architect's Corner
Servlet adapters can solve your socket problems
Many of us have been in situations where we needed more freedom and flexibility than provided by HTTP or HTTPs (ports 80 or 443), but had access denied by firewall and security features. One way to get around this, without breaking any permission, is by creating servlet adapters.
|
|
Advanced Socket Programming:
Transporting Objects over Sockets
Many of us have been in situations where we needed more freedom and flexibility than provided by HTTP or HTTPs (ports 80 or 443), but had access denied by firewall and security features. One way to get around this, without breaking any permission, is by creating servlet adapters.
|
|
Overview of Networking
Before plowing through the examples in the next several lessons, you should have an understanding of some networking basics. Also, to boost your confidence, we've included a section that reviews what you may already know about networking in Java without even realizing it.
|
|
Dynamic JNLP
This tutorial examines a custom, dynamic implementation of Java Network Launch Protocol (JNLP) to shift some of the server's processing load to the client. Veteran developer Claude Lacombe draws on his experience developing an industrial-sized application that required some modifications to JNLP and presents the fruits of his labor. A fully-functioning application is provided for guidance.
|
|
Understanding Sockets in Unix, NT, and Java
In software development these days, networks are all-important. For example, Sun Microsystems uses the slogan, "the network is the computer." IBM promotes a network-based business model called "e-business." It's taken for granted that programs talk to each other across the network. But just how do they do it? Surprisingly, a technology that is more than 15 years old still provides the foundation for most of today's connectivity at the application level. This technology is based on an idea called sockets.
|
|
Magic with Merlin: Java networking enhancements
The java.net package changed extensively with the Merlin release. Not only were six classes and three exceptions added, but also many of the existing classes were changed to support additional features, such as improving URL encoding and decoding.
|
|
Merlin brings nonblocking I/O to the Java platform
The Java technology platform is long overdue for a nonblocking I/O mechanism. Fortunately, Merlin (JDK 1.4) has a magic wand for almost every occasion, and unblocking blocked I/O is this magician's specialty. Software engineers Aruna Kalagnanam and Balu G introduce the nonblocking features of Merlin's new I/O package, java.nio (NIO), and employ a socket-programming example to show you just what NIO can do.
|
|
Java sockets 101
This tutorial will teach you what sockets are and how to use them in your Java programs. Through several hands-on examples, ranging from single client/sever communication to a pooled collection of clients accessing the server, you will learn how to use sockets to handle typical scenarios that crop up in the real world.
|
|
Network-Aware Programming
Network-aware programming with Java is not very hard to understand. Only a few classes and procedures need to be followed when you're dealing with the java.net package. The tricky part is understanding exactly how communication takes place. Once you have this understanding and you know what methods and procedures to use in the java.net package, you should be able to develop network-enabled Java programs with very little trouble. This chapter gives you a deeper understanding of how communication takes place in Java and on the Internet, and what you need to know to effectively design a Java program to connect to the Internet, a server, or even another applet.
|
|
Java and SNA: A case study
This report describes a Java tool kit for CPI-C programmers. As published by Sun Microsytems, Java supports on sockets programs on IP network. We describe a tool kit that allows programmers to write LU6.2 programs in Java. We also include preliminary performance measurements.
|
|
Custom SSL for advanced JSSE developers
JSSE brings secure communications to Java applications, by using SSL to encrypt and protect data as it travels across a network. In this advanced look at the technology, Java middleware developer Ian Parkinson delves into the lesser-known aspects of the JSSE API, showing you how to program your way around some of the restrictions of SSL. Learn how to dynamically select the KeyStore and TrustStore, relax JSSE's password-matching requirements, and build your own customized KeyManager implementation.
|
|
Build secure network applications with SSL and the JSSE API
SSL (Secure Socket Layer) is the de facto standard for securing a communication channel between two applications that converse over the Internet. Sun's JSSE (Java Secure Socket Extension) provides SSL support for Java applications. This month, Todd Sundsted demystifies JSSE and demonstrates how to SSL-enable your applications.
|
|
Create your own HTTPS tunneling socket for your Java Secure Socket Extension application
Sun's Java Secure Socket Extension (JSSE) library allows you to access a secure Web server from behind a firewall via proxy tunneling. However, JSSE expects the proxy's reply to the tunneling request to begin with "HTTP 1.0"; otherwise, it throws an IOException. If your proxy doesn't respond accordingly, you must implement your own proxy tunneling protocol. This tip shows you how to open an SSLSocket that tunnels through the proxy, and use it with the URLConnection APIs to communicate with secure Web servers from behind the firewall
|
|
Tunneling through the corporate network
The corporate firewall is a double-edged sword. It helps prevent unauthorized access to the corporate Web services, but can disable access for legitimate clients. Due to the number of safety measures taken by system administrators, HTTP has become the universal entry mechanism to the corporate network. Where technologies such as CORBA and DCOM have failed because of the firewall, technologies such as SOAP have been developed to provide safe and reliable access through firewall protection. In this article, we will explore an alternative to SOAP, the use of Java objects over HTTP. In addition, we will use J2EE servlet technology as server-side middleware to the business data.
|
|
The practice of peer-to-peer computing: P2P meets SSL
A core requirement of any non-trivial P2P application is secure communication between peers. While the details of the security depend on how the application will be used and on what it will protect, it's often possible to implement strong, general-purpose security using off-the-shelf technology such as SSL. This month, Todd Sundsted demonstrates how to use SSL (via JSSE) in P2P security.
|
|
Using JSSE for secure socket communication
This tutorial explains the use of the Java Secure Socket Extension (JSSE) packages included in JDK 1.4. The complexity of using JSSE is not in the communication itself, but rather in the configuration. Before you can run your client/server software, you must create the keys needed by the encryption algorithms, and these keys must be properly loaded by your software before it can create secure sockets. This tutorial provides cookbook-style instructions for creating and installing JSSE encryption keys in a client/server application environment.
|
|
RunTime: Programming sockets
In last month's column, Ed covered synchronization primitives and gave a reprise on pipes. This month he takes a first look at communication using sockets. Ed demonstrates some techniques for writing a sockets program and shows how his programming techniques perform in various operating system environments. Share your thoughts on this article with the author and other readers in the discussion forum by clicking Discuss at the top or bottom of the article.
|
|
Advanced MIDP Networking, Accessing Using Sockets and RMI from MIDP-enabled Devices
The Connected Limited Device Configuration (CLDC) provides a Generic Connection Framework that can be used to develop network-based applications. In addition, the Mobile Information Device Profile (MIDP) provides the HttpConnection interface, which is part of the javax.microedition.io package, that defines the necessary methods and constants for an HTTP connection. HTTP is the only protocol a MIDP implementation must support, all other protocols are optional. For example, in the reference implementation from Sun, there is no support for either Transport Control Protocol (TCP) sockets or User Datagram Protocol (UDP) datagrams.
|
|
Introduction to the Peer-to-Peer Sockets Project
The Peer-to-Peer (P2P) Sockets Project reimplements Java's standard Socket, ServerSocket, and InetAddress classes to work on the JXTA peer-to-peer network, rather than on the standard TCP/IP network. It also includes ports of many popular web packages, such as the Jetty web server, the Apache XML-RPC client and server libraries, and the Apache Jasper JSP engine, to run on the Peer-to-Peer Sockets framework.
|
|
Networking with Sockets
Sockets provide a TCP/IP communications protocol. Supported by all operating systems.
Sockets are the de facto portable network
communication standard
|
|
Java Sockets
and URLs
At the heart of everything we discuss in this book is the notion of interprocess
communication (IPC). In this chapter, we will look at some examples using Java
mechanisms for interprocess communication. IPC is a fancy way of saying “two
or more Java programs talking with each other.” Usually the programs execute on
different computers, but sometimes they may execute on the same host.
|
|
TCP/IP and Network Programming in C and Java
TCP/IP Introduction
|
|
To java.net and Beyond
Teaching Networking Concepts Using
the Java Networking API
This paper covers the use of Java and its API for developing networking
programs in an undergraduate computer networks class.
|
|
Character streams
With the basic byte-oriented streams, support for the communication of textual data
was fairly limited. Other than some crude support from the data streams, all text com-munications
were assumed to be in 8-bit ASCII (ISO Latin 1). This was clearly incom-mensurable
with Java’s cross-platform nature and the 16-bit Unicode character set
supported by the language.
|
|
Some example TCP/IP clients
In this chapter, we examine the implementation of some simple TCP clients that inter-act
with existing Internet protocols. Specifically, we will look at a finger client (RFC
1288) and a DNS client (RFC 1035), the equivalent of the nslookup command. These
clients can serve as the basis for implementations of other Internet protocols that possess
similar structures.
|
|
A COLLABORATIVE LEARNING ENVIRONMENT USING JAVA SOCKETS
This project makes use of the latest JAVA networking technology to create a
collaborative learning environment for students to discuss academic problems. The participants
in our environment can be distributed and they are not constrained by geographic space. Several
design issues have been considered, including deadlock and livelock problems and the disparities
in national culture. Our product can be used by schools for students to interact collaboratively in
a virtual environment with their counter-parts in other schools and even in other countries.
|
|
Java Sockets Examples
|
|
Sockets programming in Java: A tutorial
Writing client/server applications can be challenging and fun, especially with Java. Find out how sockets programming in Java is seamless.
|
|
Network Programming with the java.net Package
The java.net package provides a set of classes that support network programming using the communication protocols employed by the Internet. These protocols are known as the Internet protocol suite and include the Internet Protocol (IP), the Transport Control Protocol (TCP), and the User Datagram Protocol (UDP) as well as other, less-prominent supporting protocols.
|
|
Running TCP/IP Sockets on Palm OS.
This manual is written for the people with computer background. Tests were done on a Windows 2000 system with IBM Visual Age Microedition 1.2 (VAME 1.2) and on PalmOS system ver 3.3 running on IBM Workpad (Palm IIIx). It is valid only for this configuration however instructions from this manual can be helpful as well for a Linux system and different versions of Windows or PalmOS.
|
|
Sockets Versus CORBA/Java ORBs
|
|
Network Programming - Sockets
Sockets come in three varieties which are implemented by the Java classes named Socket, DatagramSocket, and ServerSocket. The first two socket classes represent TCP and UDP communications respectively.
|
|
Networking with Java
Yesterday you learned what multiplayer games are and why they are so important. Today you take one more step toward creating a networked multiplayer game that can be played over the Internet. I know, you're probably itching to move on and see a full-blown network game. However, you still need to cover some ground in regard to what is required behind the scenes to facilitate network communication in a real game. Trust me, you'll be dealing with the intricacies of network game programming soon enough.
|
|
Java TCP Sockets and Swing Tutorial
This tutorial is aimed for programmers with at least a little experience with Java. For introductory material on Java, check out Sun's Java Tutorial and Java Documentation, which can be accessed from Sun's Java home page. Information on how to compile and run programs is also available there
|