Skip to content

Commit 973b4bb

Browse files
committed
completed UDP 基础
1 parent 3074027 commit 973b4bb

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

NETTY BY EXAMPLE/UDP Basics.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
UDP 基础
2+
====
3+
4+
面向连接的传输协议(如TCP)管理建立一个两个网络端点之间调用(或“连接”),命令和可靠的消息传输在调用的生命周期期间,最后有序在调用终止时终止。与此相反,在这样一个无连接协议 UDP 没有持久连接的概念,每个消息(UDP 数据报)是一个独立的传播。
5+
6+
此外,UDP 没有 TCP 的纠错机制,其中每个对等承认它接收的数据包并由发送方传送包。
7+
8+
以此类推,一个 TCP 连接就像一个电话交谈,一系列的命令消息流在两个方向上。UDP,另一方面,就像把一堆明信片丢进信箱。我们不能知道他们到达目的地的顺序,以及他们是否能够到达。
9+
10+
虽然 UDP 存在某些方面的的局限性,这也解释了为什么它是如此远远快于TCP:所有的握手和消息管理的开销已被消灭。显然,UDP 是一种只适合应用程序可以处理或容忍丢失消息,而不是例如处理金钱交易。

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ This is the summary of my book.
8282
* [启动 SpdyServer 并测试](NETTY BY EXAMPLE/Start the SpdyServer and test it.md)
8383
* [总结](NETTY BY EXAMPLE/12.5 Summary.md)
8484
* [通过 UDP 广播事件](NETTY BY EXAMPLE/Broadcasting events with UDP.md)
85+
* [UDP 基础](NETTY BY EXAMPLE/UDP Basics.md)
8586
* 高级主题
8687
* [实现自定义编解码器](ADVANCED TOPICS/Implement a custom codec.md)
8788
* [EventLoop 和线程模型](ADVANCED TOPICS/EventLoop and thread model.md)

0 commit comments

Comments
 (0)