Welcome to the Networking section! This section focuses on how Java allows computers to communicate over a network using various protocols.
- IP Address Lookup - How to retrieve the IP address of a host.
- Sockets - Using TCP/IP sockets to build a client-server application.
- Echo Server/Client - Build simple echo server-client programs.
-
HostNameToIP.java
- A program that accepts a hostname and displays its IP address.- Concepts: Working with
InetAddress
to resolve IP addresses.
- Concepts: Working with
-
EchoServer.java
&EchoClient.java
- A pair of programs where the client sends a message to the server, and the server echoes it back.- Concepts: Working with
ServerSocket
,Socket
, and streams.
- Concepts: Working with
-
TCPClientServer.java
- A simple client-server program using TCP/IP, where the client sends messages to the server.- Concepts: Using TCP/IP sockets to exchange messages between client and server.
- Write a program to display the IP address of any website by accepting the hostname from the user.
- Write a simple echo server-client program where the server echoes whatever the client sends.
- Create a TCP client-server application that sends a message from the client to the server and logs the message on both ends.
After understanding the basics of networking, you can dive deeper into more advanced network programming topics like multithreaded servers, file transfer protocols, and web services.
- HostNameToIP.java: Displays IP address of a given host name.
- EchoServer.java: Echo server using sockets.
- EchoClient.java: Echo client using sockets.
- TCPClientServer.java: TCP/IP client-server program.