Communicating with TCP/IP
Because it's so common, I'll start by using TCP/IP client server examples in the next
few videos.
This means, I'll use a reliable two-way communication link between the client and
the server.
At the end of the last video I talked about the fact that I'll need to write two
applications, to demonstrate how to do network coding.
One application will be the server, the other will be the client.
COMPLETE JAVA MASTERCLASS
Creating a Simple Client-Server Connection using
ServerSocket
The Typical TCP/IP Client-Server Interaction
• The Server needs to first create a ServerSocket, and bind it to a port.
• The Server calls accept() on the ServerSocket, which returns a Socket when a
client connects.
• The Client creates a Socket using a constructor that takes a host and port.
• The Server and Client use their respective sockets to exchange data.
COMPLETE JAVA MASTERCLASS
Creating a Simple Client-Server Connection using
ServerSocket