Here is the listing of Java programming examples on Networking.
1. Java Examples on URLConnection
Uniform Resource Locator (URL) provides a reasonably intelligible form to uniquely identify or address information on the Internet. URLs are ubiquitous. Java’s URL class has several constructors, each can throw a MalformedURLException. URLConnection is a general-purpose class for accessing the attributes of a remote resource. This section contains Java programs on retrieving different parts of url supplied to url class object, accepting website name and returns the ipaddress.
Java Program to Retrieve Different Parts of a URL Supplied to URL Class Object
Java Program to Accept a WebSite Name and Return its IPAddress After Checking it on Internet
2. Java Examples on Networking
In Java, networking is performed using Transmission Control Protocol/Internet Protocol or the User Datagram Protocol. java.net package contains the classes and interfaces required for networking. Some important classes are MulticastSocket, ContentHandler, URLServerSocket, etc. Interfaces in the java.net package are ontentHandlerFactory, SocketImplFactory, FileNameMap etc. CommandProcessor singleton class is responsible for managing the execution of the IDE commands and managing the undo stack. Forwarder-Receiver design pattern Provides transparent inter process communication for software systems with peer-to-peer interaction model. This section contains Java programs on Publisher-Subscriber, Command Processor and Forwarder-Receiver concepts.
Java Program Which Java Program for a Object to a File Using Transient Variable Also
Java Program to Illustrate Publisher-Subscriber
Java Program to Illustrate Command Processor Concept
Java Program to Illustrate Forwarder-Receiver Concept
3. Java Examples on TCP/IP Client & Server Sockets
There are two kinds of TCP sockets in Java. One is for servers, and the other is for clients. The ServerSocket class is designed to be a “listener,” which waits for clients to connect before doing anything. Thus, ServerSocket is for servers. The Socket class is for clients. Creation of a Socket object implicitly establishes a connection between the client and server. Datagrams are bundles of information passed between machines. BufferedReader improves performance by buffering input. This section contains programs on creating a server to send some strings to client, using datagram socket for client server communication, rpc implementation using client-dispatcher server, creating client to accept the strings from server and proxy web server using proxy.
Java Program to Create a Server for the Purpose of Sending Some Strings to the Client
Java Program to Create Client Side Program, Which Accepts All the Strings Sent by the Server
Java Program to Create a Server that Recieves Data from the Client Using BufferedReader and Sends Reply to the Client Using PrintStream
Java Program that Accepts the FileName and Checks for its Existence. When the File Exists at Server Side, it Send its Contents to the Client
Java Program of a Client Program to Acccept a File Name from the KeyBoard and Send that Name to the Server. The Client Recieves the File Contents from the Server
Java Program to Use Datagram Socket for Client Server Communication
Java Program of a Simplified Implementation of RPC Using Client-Dispatcher-Server
Java Program of a Highly Simplified Implementation of a Proxy Web Server Using Proxy