首页 > 编程语言 > 详细

How to support both ipv4 and ipv6 address for JAVA code.

时间:2014-07-11 12:50:58      阅读:378      评论:0      收藏:0      [点我收藏+]


IPv6 have colon character, for example FF:00::EE
If concatenate URL String, IPv6 URL will like:
 http://FF:00::EE:8888/a/b/c
Actually we want:
 http://[FF:00::EE]:8888/a/b/c
Simply concatenate URL will cause error.

Take above line for example.

If not use square bracket, can’t identify “8888” is port or part of IPv6 address.
Please use the following code to create new URI
  new URI("http", null,<host>, <port>, <additional URL>, null, null)

How to support both ipv4 and ipv6 address for JAVA code.,布布扣,bubuko.com

How to support both ipv4 and ipv6 address for JAVA code.

原文:http://www.cnblogs.com/lpthread/p/3833913.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!