![]() Create a socket with the socket() system call. ![]() Steps to create a client using TCP/IP API The left-hand column represents the client and the right-hand side is the server. To better understand check out the sequence of socket API calls and data flow for TCP client-server communication. Sequence of socket API calls and data flow: After getting the message server will check the received message and send a proper response as per the received message. In this example, After the connection with a client, the server will wait for a message from the client. ![]() Note: here I am creating the server and client for Linux. ie, the client begins the communication and establishes a connection with a server.įor more understanding let’s create a server that continuously runs and establish the connection after getting a request from the client. The communication over the network in TCP/IP model takes place in form of a client-server architecture. ![]() If an acknowledgment is not received, after a certain amount of time transmitted data will be lost and TCP automatically retransmits the data. TCP also offers the facility of retransmission, when a TCP client sends data to the server, it requires an acknowledgment in return. Major Internet applications such as the World Wide Web, email, remote administration, and file transfer rely on TCP. In TCP before sending the data it breaks the large data into smaller packets and cares the integrity of the data at the time of reassembling at the destination node. TCP creates a connection between the source and destination node before transmitting the data and keeps the connection alive until the communication is active.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |