Open Lybecker opened 6 years ago
Ah, good catch. I haven't been able to test with IPv6 yet, i'll get onto that soon.
I have a pull request coming up... Just cannot figure out how to create unit tests
On Fri, Aug 24, 2018 at 11:50 AM, Roman Vaughan notifications@github.com wrote:
Ah, good catch. I haven't been able to test with IPv6 yet, i'll get onto that soon.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NZSmartie/CoAP.Net/issues/14#issuecomment-415711016, or mute the thread https://github.com/notifications/unsubscribe-auth/ADvRrX7S2cXrfG_Pj1RnOHT_KsuPpo5aks5uT8xjgaJpZM4WLD9g .
If you submit what you have so far as a PR, i can investigate the tests
@Lybecker, @NZSmartie
I'm testing the out of the box client and server with your merged changes under VS2019. I'm getting a curious exception related to the section of code that was changed above (I think).
System.Net.Sockets.SocketException: 'An invalid argument was supplied'
This happens immediately when the client tries to send the hello put to the server. The full stack trace I get in my client window is this:
Exception caught: System.Net.Sockets.SocketException (0x80004005): An invalid argument was supplied
at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at CoAPNet.Udp.CoapUdpEndPoint.BindAsync() in C:\Dev\CoAP.Net.git\src\CoAPNet.Udp\CoapUdpEndPoint.cs:line 100
at CoAPNet.Udp.CoapUdpEndPoint.
Do you have any insights for this? I haven't looked into it yet unfortunately. I'm just shopping for .net coap libraries. I'm a little surprised the demo client/server didn't work out of the box.
Thoughts?
It is due to the client tries to bind twice to the same endpoint in two different threads. I don't know why
Current implementation of CoapUdpEndPoint does not support IPv4 and IPv6 at the same time.
Actually the default constructor CoapUdpEndPoint is hardcoded to IPv4 with the IPAddress.Any (Any means IPv4 and IPv6Any means IPv6) The samples was ailing due to this, so I set out to figure out why and lean myself. So I wrote a blog post: http://www.lybecker.com/blog/2018/08/23/supporting-ipv4-and-ipv6-dual-mode-network-with-one-socket/