Building Java Client/Server Applications with TCP

Luxoft Training
2 min readFeb 18, 2020

--

Abstract: TCP (Transmission Control Protocol) is a connection-based protocol that provides a reliable flow of data between two computers. It also provides a point-to-point channel for applications that require reliable communications. The Java programming language supports, through the java.net package, a suitable API for developing client/server applications that use this protocol for communication.

1.The principles of the TCP protocol

The TCP protocol requires the establishment of a session between the client and the server. A session essentially is a mechanism to get some data, so we are setting up a specialized communication session.

TCP behaves so similarly to a conversation on the phone.

  • Pick up the phone
  • Wait for the dial tone
  • Dial the number
  • Phone rings
  • Pick up the phone
  • Say hello
  • Start the conversation
  • Repeat if you haven’t understood something

A three-way handshake (or TCP handshake) is a method used in a TCP/IP network to create a connection between a local host/client and server. It is a three-step method that requires both the client and server to exchange SYN and ACK (acknowledgment) packets before actual data communication begins.

Find out more at — http://bit.ly/39EAE2M

Originally published at https://www.luxoft-training.com.

--

--

No responses yet