Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What are the steps that are followed when two computers connect through TCP?
Home
JAVA
What are the steps that are followed when two computers connect through TCP?
+1
vote
asked
May 7, 2021
in
JAVA
by
sharadyadav1986
What are the steps that are followed when two computers connect through TCP?
#socket-programming
tcp
Java-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
May 7, 2021
by
sharadyadav1986
There are the following steps that are performed when two computers connect through TCP.
The ServerSocket object is instantiated by the server which denotes the port number to which, the connection will be made.
After instantiating the ServerSocket object, the server invokes accept() method of ServerSocket class which makes server wait until the client attempts to connect to the server on the given port.
Meanwhile, the server is waiting, a socket is created by the client by instantiating Socket class. The socket class constructor accepts the server port number and server name.
The Socket class constructor attempts to connect with the server on the specified name. If the connection is established, the client will have a socket object that can communicate with the server.
The accept() method invoked by the server returns a reference to the new socket on the server that is connected with the server.
Related questions
0
votes
Q: The process that involves analyzing entities like TCP and ICMP to identify an application or an operating system
asked
Aug 17, 2021
in
Security Assessment
by
Robindeniel
tcp
icmp
operating-system
0
votes
Q: UDP and TCP are called ________ protocols:
asked
Dec 2, 2022
in
IOT Prime
by
john ganales
udp
tcp
gateway
0
votes
Q: Write down the name of services provided by TCP?
asked
Jan 24
in
Other
by
SakshiSharma
tcp
0
votes
Q: Write the steps to connect to a database in Java?
asked
Feb 9, 2021
in
JAVA
by
SakshiSharma
#database-java
java-database
database-connection
Java-questions-answers
0
votes
Q: Is it necessary that each try block must be followed by a catch block?
asked
May 3, 2021
in
JAVA
by
Robindeniel
#catch-block
java
Java-questions-answers
+1
vote
Q: Continuous Deployment (CD) has six elements that, when followed, keep each team member, team, and the Agile Release Train on track. Which two statements best describe elements of CD?
asked
Jul 31, 2019
in
Agile
by
sheetalkhandelwal
#agile-development
#agile-methodology
#scaled-agile
#scaled-agile-framework
#agile-process
#agile-vs-scrum
#agile-methodologies
#what-is-safe
#safe-agile
#safe-methodology
+5
votes
Q: Continuous Deployment (CD) has six elements that, when followed, keep each team member, team, and the Agile Release Train on track. Which two statements best describe elements of CD?
asked
Jun 17, 2019
in
Agile
by
tempuser123
#safe-agile
0
votes
Q: True or False: In JSON Syntax, each name is followed by : (colon) and the name/value pairs are separated by ; (semicolon).
asked
Jan 23, 2020
in
JAVA
by
rahuljain1
#json-syntax
Java-questions-answers
0
votes
Q: What do we call a collection of two or more computers that are located within a limited distance of each other and that are connected to each other directly or indirectly?
asked
Oct 20, 2019
in
Other
by
KeshavVyas
#gk
#currentaffair
#generalknowlege
+1
vote
Q: What Are The Two Types Of Calls That Can Be Developed Using Apigee Sdk?
asked
Feb 18, 2020
in
JAVA
by
rahuljain1
#apigee-sdk
Java-questions-answers
...