
Learn to build client-server network applications in Java using TCP or UDP, with practical examples, hands-on tasks, solutions, and Wireshark-based analysis.
Install the Java Development Kit from Oracle, download and set up Eclipse, install the Eclipse IDE for Java Developers, accept licenses and certificates, choose a workspace, and launch Eclipse.
Set up Eclipse by choosing a workspace and creating a Java project, then create a package and a hello world class, follow lowercase package naming convention, and learn import export.
Create a simple tcp server in java by building a server socket on port 2020, accepting a client, and exchanging messages using buffered input and print writer output.
This lesson shows a simple Java tcp client that connects to localhost:2020, reads the server's welcome message, sends Thanks!, and closes the socket.
Learn how a simple tcp program uses the main method, server socket setup, and buffered input/output streams to handle client connections, exchange welcome and thanks messages, and close the sockets.
This lesson extends the simple tcp program by enabling the client to send a custom message and participate in a number guessing game with the server.
Observe a live TCP exchange in Wireshark: a three-way handshake, a 10-byte 'Welcome!' message with the push flag, followed by the client 'Thanks!' and socket closure.
Create a simple TCP server in Java that handles multiple clients by opening a socket on port 2020 and spawning a new thread per connection with a ServerThread implementing Runnable.
Advance the multithreaded tcp program by moving the client counter to the server main, exposing getClientNumber and printing 'client n has connected' and 'client n has disconnected'.
Explore bonus network tasks including a server that echoes text in upper case, reverses text, and a number guessing game from 1 to 20 for multiple clients, with solutions attached.
Explore UDP socket programming in Java by building a receiver that handles datagrams, explains the difference between TCP and UDP, uses DatagramSocket and DatagramPacket, and demonstrates sending and receiving messages.
Describe the sender side of a simple UDP program, prompting for a message, sending a DatagramPacket via a socket, and receiving via a buffer, noting UDP has no prior connection.
Add an indefinite while(true) loop in a new simple_udp2 package to enable continuous sender–receiver UDP communication using DatagramSocket, packets, and payloads.
If you have a great idea for an app that needs to communicate through a network, or you're just beginning to learn Java, or you're a network engineer looking to implement one of many network protocols, you've come to the right place!
In this course, you'll get the tools to build both client-server and peer-to-peer applications. We'll cover both the use of TCP and UDP sockets, and I'll leave it to you to choose which one suits your application better. There are some bonus examples that you can use to practice, and you're more than welcome to post your questions, ideas or struggles in the Q&A section.
All of the code is thoroughly explained, so you don't need much prior Java knowledge, but basic understanding of programming in general is a plus.
Generally, network applications differ from non-network applications in their distributed nature, reliance on network protocols, client-server architecture, handling of network-related challenges, and utilization of web-based technologies. The networking aspect of these applications opens up opportunities for collaboration, remote access, and resource sharing, making them essential in today's interconnected world - which is why we'll learn about them in this course!
All feedback is welcome, so I encourage you to suggest ways to improve this course, but also criticize where needed. :) Hope you find it useful & learn something important here!