开发者

How to write a IPV6 loopback address in array form

开发者 https://www.devze.com 2023-03-04 03:03 出处:网络
The IPV4 address has been written as { 127, 0, 0, 1 } How to write the loopback address in IPV6 in this format. Do I need to take a 16 sized开发者_JAVA百科 array???

The IPV4 address has been written as { 127, 0, 0, 1 } How to write the loopback address in IPV6 in this format. Do I need to take a 16 sized开发者_JAVA百科 array??? Isnt there any better way ???


Well, IPv6 has many "shortened" forms, so that a loopback address can be written as ::1 - however, in an array, you'd need to spell out the entire thing (16 * 8 = 128 bits):

{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号