Method: UdpClient.SendAsync Method (Byte[], Int32, IPEndPoint)
The call above willingly takes the Byte[] part by using 83 ⎕DR [text data to send], so to that part it's seems ok.
The problem is System.Net.IPEndPoint:
http://msdn.microsoft.com/en-us/library/system.net.ipendpoint.aspx
Code: Select all
public IPEndPoint(
IPAddress address,
int port
)
IPEndPoint.New requires an IP address and a port. It works if the IP address is IP4, then i can pass the 4 integers to the IPAddress constructor, and it goes right.
BUT: I must pass IPv6 addresses, that i manage as text vectors. An IPv6 address is eg. 'fe80::f9cc:d1aa:520a:4f1%11'.
I've tried everything that comes to my mind. But i'm simply unable to construct an IPAddress, because it requires Byte[].
http://msdn.microsoft.com/en-us/library/s128tyf6.aspx
Code: Select all
public IPAddress(
byte[] address
)
I'd like to say eg.:
IPAddress.New ⊂'fe80::f9cc:d1aa:520a:4f1%11'
No go, as all related options, since they all use Byte[].
How do i create the IPAddress object? This simple, annoying problem invalidates everyting. I saw there was some Byte[] discussion in the forum, but no good solution. I cannot loop through the address character by character; even if i can create a System.Array.CreateInstance(Byte), i wouldn't like to populate it by looping - too little time for that! There must be a better solution!?!?
(APl 13.2, framework 4.5)