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.的更多相关文章

  1. golang 判断IPv4 or IPv6 address

    import strings func IsIPv4(address string) bool { return strings.Count(address, ":") < ...

  2. ipv4与ipv6 Inet4Address类和Inet6Address类

    在设置本地IP地址的时候,一些人会疑惑IPv4与IPv6的区别是什么?下面由学习啦小编为你分享ipv4与ipv6的区别的相关内容,希望对大家有所帮助. ipv4与ipv6的区别 在windows 7以 ...

  3. ipv4、ipv6的socket同时监听“bind: Address already in use”的解决方法

    创建ipv4和ipv6的socket,同时监听某个端口的ipv4和ipv6报文,运行时bind函数执行失败,提示“bind: Address already in use”.原因:ipv6的socke ...

  4. RFC2474 - Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers的双语版

    RFC2474 - Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers英文版 ...

  5. Convert IPv6 Address to IP numbers (C#)

    URL: http://lite.ip2location.com/ Use the code below to convert the IP address of your web visitors ...

  6. IPv6 tutorial 4 IPv6 address syntax

    https://4sysops.com/archives/ipv6-tutorial-part-4-ipv6-address-syntax/ Now that you know about the n ...

  7. IPv6下网络编程socket, TCP和UDP例子,以及兼容IPV4和IPV6的类

    一.TCP socket ipv6与ipv4的区别 服务器端源代码如下: #include <stdio.h> #include <stdlib.h> #include < ...

  8. IPv4到IPv6的三种过渡技术

    1. 双协议栈 ( Dual Stack, RFC2893 ) 主机同时运行IPv4和IPv6两套协议栈,同时支持两套协议. 2. 隧道技术 ( Tunnel, RFC2893 ) 这种机制用来在IP ...

  9. windows 获取本机(全部)IPv4、IPv6、MAC地址方法 (C/C++)

    windows下获取IP地址的两种方法: 一种可以获取IPv4和IPv6,但是需要WSAStartup: 一种只能取到IPv4,但是不需要WSAStartup: 如下: 方法一:(可以获取IPv4和I ...

随机推荐

  1. [spoj] FTOUR2 FREE TOUR II || 树分治

    原题 给出一颗有n个点的树,其中有M个点是拥挤的,请选出一条最多包含k个拥挤的点的路径使得经过的权值和最大. 正常树分治,每次处理路径,更新答案. 计算每棵子树的deep(本题以经过拥挤节点个数作为d ...

  2. POJ 3041 Asteroids | 匈牙利算法模板

    emmmmm 让你敲个匈牙利 #include<cstdio> #include<algorithm> #include<cstring> #define N 51 ...

  3. idea创建maven项目需要注意的问题

    idea创建maven项目之后,我从deployment中看到报部署错误的问题,下图是解决问题的办法如下图所示:

  4. Linux命令之Nano基础指南

    Nano基础指南 1.  Nano基础 目的 这是篇nano简明使用指南,帮助你快速了解nano的基本用法.如想获取更多的帮助信息,请参阅: http://www.nano-editor.org 打开 ...

  5. poj 3729 Facer’s string

    Facer’s string Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 2155   Accepted: 644 Des ...

  6. glEnable(GL_DEPTH_TEST)的问题

    http://www.gameres.com/msg_195903.html 在程序中加入glEnable(GL_DEPTH_TEST)之后显示就完全黑屏了,即使是清空了深度缓冲glClear(GL_ ...

  7. This Android SDK requires Android Developer Toolkit version 20.0.0 or above

    本人最近在操作更新ANDROID SDK时出现类似于题目中的错误,是一启动ECLIPSE时.但是,我现在只是想恢复到原先的开发环境.于是找到本文,方法有效!!! windows 下面安装Android ...

  8. 使用Sublime Text 3 编写python

    1,下载Sublime Text 3 链接:http://pan.baidu.com/s/1eROBpB0 密码:cqjr 2,安装 注意安装时去掉捆绑的软件安装选项,有两处. 3,安装完成打开软件, ...

  9. [UML] Use Case 是什么

    虽然每个人使用系统的场景有所差异,但是若用户的目标是相同的,则其场景会极为类似.那么这些类似的场景的集合就是类,这种类就称为Use Case.其实例就是场景

  10. 51nod 1433 0和5【数论/九余定理】

    1433 0和5 题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题  收藏  关注 小K手中有n张牌,每张牌上有一个一位数的数,这个 ...