What is IP address '::1'?

前端 未结 2 949
遥遥无期
遥遥无期 2020-11-28 06:06

I was playing with sockets on local machine with no network connection. See below:

IPAddress address = IPAddress.Any; // doesn\'t work
IPAddress address = IP         


        
2条回答
  •  抹茶落季
    2020-11-28 06:47

    Just to add little more info to it, in IPv6 loopback address is represented as 127 zeroes followed by a 1 i.e (0000... 127 times..1). It's representation should have been like this -> 0000:0000:0000:0000:0000:0000:0000:0001 but we have some short form representation for this. If there are all zeroes in a single block you can replace it by single 0. So it becomes -> 0:0:0:0:0:0:0:0001. Again we can see that we have runs of zeroes, they can be eliminated and we get -> ::0001 -> ::1 .

提交回复
热议问题