5 years ago (2015-05-22)  computer technology |   First to comment  4 
post score 0 times, average 0.0

This is the EX2 of SSD8 practice. It is expected that the extreme guests will write a series. This series is entirely personalized by Wang Baiyuan and the update frequency will be synchronized with the 2013 level of the NWPU database system experimental class.Click on the tag or search for "SSD8" on this site to get updated SSD8 answers.The previous exercise: SSD8_EX1 [Java implementation code for Socket Communications]; if you want to continue tracking SSD practice, it is recommended to subscribe to this site.

Brief description of the problem

Write a simple datagram program based on C/S (client/server) mode in Java.The client sets a timer. After the timer starts, it sends a one-byte packet to the server using UDP and TCP, respectively, and waits for the server to return a message.Calculate the average round trip time, calculate the number of packet loss during UDP transmission and implement packet loss retransmission.

First, using UDP to achieve packet loss retransmission, packet loss count and transmission timing

1.UDP server program UDPServer.java


2.UDP client program UDPClient.java


Second, using TCP to achieve transmission timing

1.TCP server program TcpServer.java


2 based on the TCP protocol client class



This article has been printed on copyright and is protected by copyright laws. It must not be reproduced without permission.If you need to reprint, please contact the author or visit the copyright to obtain the authorization. If you feel that this article is useful to you, you can click the "Sponsoring Author" below to call the author!

Reprinted Note Source: Baiyuan's Blog>>https://wangbaiyuan.cn/en/ssd8-ex2-udp-vs-tcp-2.html

Post comment


No Comment


Forget password?