Apple over-trial IPv6 problem

Source: Internet
Author: User

Apple over the trial there is a must through the IPv6 network test game, the first idea is to achieve two sets of socket link, the server also realized IPv6, then Baidu is actually very simple, direct dns.gethostaddresses (string hostnameoraddress) Get the link address, hostnameoraddress the domain name address, domain name binding server IP is good, the following is the complete code:

Get the remote server IP address
ipaddress[] address = dns.gethostaddresses (host);
if (address. Length = = 0)
{
Debug.logerror ("address. Length = = 0 ");
Return
}

Determine if the current network is IPv6 to establish a different link
if (Address[0]. AddressFamily = = addressfamily.internetworkv6)
{
Client = new TcpClient (ADDRESSFAMILY.INTERNETWORKV6);
}
Else
{
Client = new TcpClient (addressfamily.internetwork);
}


Establish links
Client. Nodelay = true;
try {
Client. BeginConnect (Address[0], Port, new AsyncCallback (OnConnect), null);
} catch (Exception e) {
Close (); Debug.logerror (E.message);
}

  

Apple over-trial IPv6 problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.