Bug #568

avatar

Ipv6 support

Added by UO UO 5048 days ago.

Status:New Start:02/25/2011
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:- Spent time: -
Target version:-
Votes: 0

Description

I found two ipv6 bugs.

1. URI exception in SocketListener.EndAccept

Problem line:
Uri uri = new Uri("tcp://" + endpoint.Address.ToString() + ':' + endpoint.Port);
It will raise exception "Invalid URI: A port was expected because of there is a colon (':') ..... " 
Because ipv6 uses ":" to seperate each section, it violates the uri name rule.
This line should like this for ipv6 usage.
uri = new Uri("tcp://[" + endpoint.Address.ToString() + "]:" + endpoint.Port);

2. Ipv6 listening in SocketListener.Start

problem line:
listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
This line only initializes an ipv4 listening socket.

Also available in: Atom PDF