Skip to content

Commit

Permalink
Update socket_setmulticastttl_ttl.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdejun authored Dec 24, 2017
1 parent 257922f commit 0a4a958
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions dgram/socket_setmulticastttl_ttl.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ added: v0.3.8

* `ttl` {number} Integer

Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for
"Time to Live", in this context it specifies the number of IP hops that a
packet is allowed to travel through, specifically for multicast traffic. Each
router or gateway that forwards a packet decrements the TTL. If the TTL is
decremented to 0 by a router, it will not be forwarded.

The argument passed to to `socket.setMulticastTTL()` is a number of hops
between 0 and 255. The default on most systems is `1` but can vary.
设置`IP_MULTICAST_TTL`套接字选项。
一般来说,TTL表示"生存时间"。这里特指一个IP数据包传输时允许的最大跳步数,尤其是对多播传输。
当IP数据包每向前经过一个路由或网关时,TTL值减1,若经过某个路由时,TTL值被减至0,便不再继续向前传输。

传给 `socket.setMulticastTTL()` 的参数是一个范围为0-255的跳步数。大多数系统的默认值是 `1` ,但是可以变化。

0 comments on commit 0a4a958

Please sign in to comment.