Comments (5)
Hi~
It seems there might be something incorrect with the IPv6 network interface on your OS.
The log says:
DEBUG - Starting CoAP server
Warn - Cannot start endpoint at :::5683
DEBUG - Stopping endpoint bound to :::5683
Warn - Could not start endpoint :::5683
System.Net.Sockets.SocketException: The descriptor is not a socket
The server tries to bind a socket to an IPv6 address of [::] (System.Net.IPAddress.IPv6Any
) and fails.
Please try adding the following code before starting a server:
server.AddEndPoint(IPAddress.Any, server.Config.DefaultPort);
It will bind to the IPv4 address (0.0.0.0), instead of the default IPv6 address.
You can use any other network address on your OS if you'd like to.
from coap.net.
Hi, longshine
I have tried your suggestion. It still has problem with binding.
Here is the error message.
Warn - Cannot start endpoint at 0.0.0.0:5683
DEBUG - Stopping endpoint bound to 0.0.0.0:5683
Warn - Could not start endpoint 0.0.0.0:5683
System.Net.Sockets.SocketException: The descriptor is not a socket
at System.Net.Sockets.Socket.IOControl (Int32 ioctl_code, System.Byte[] in_value, System.Byte[] out_value) [0x00033] in /build/mono/src/mono-4.4.0/mcs/class/System/System.Net.Sockets/Socket.cs:3219
at CoAP.Channel.UDPChannel.SetupUDPSocket (AddressFamily addressFamily, Int32 bufferSize) [0x00009] in <filename unknown>:0
at CoAP.Channel.UDPChannel.Start () [0x00117] in <filename unknown>:0
at CoAP.Net.CoAPEndPoint.Start () [0x00040] in <filename unknown>:0
It can not even bind to ipv4 localhost.
The only distinction my server program has is that I have not added all the resources but HelloworldResource only. But I think this shall not affect the binding, right?
In order to rule out the possibility that my system has some problem, I have compiled a C program, and server can bind correctly.
Thanks,
from coap.net.
Hi~
That's very odd. I googled and found some other projects have the same issue too, but no solution. See rabbitmq-dotnet-client and sockets-for-pcl.
CoAP resources should have nothing to do with this issue.
I found some messages in the log:
at System.Net.Sockets.Socket.IOControl (Int32 ioctl_code, System.Byte[] in_value, System.Byte[] out_value) [0x00033] in /build/mono/src/mono-4.4.0/mcs/class/System/System.Net.Sockets/Socket.cs:3219
at CoAP.Channel.UDPChannel.SetupUDPSocket (AddressFamily addressFamily, Int32 bufferSize) [0x00009] in <filename unknown>:0
There are some preparation steps when setting up a UDP socket in UDPChannel.SetupUDPSocket()
, which might not be well supported on Mono.
I will make a patch later. Are you using the binaries or the source codes?
from coap.net.
Fixed in commit 7ffdb94.
from coap.net.
Hi, longshine
This bug has been resolved.
I can get the following result.
DEBUG - Starting endpoint bound to 0.0.0.0:5683
CoAP server [RFC 7252] is listening on 0.0.0.0:5683
Even if server.AddEndPoint(IPAddress.Any,server.Config.DefaultPort);
is commented out.
Thanks,
from coap.net.
Related Issues (20)
- CoAP.NET.Core memory leak
- response with request HOT 1
- Unable to send acknowledgement from CoAP server to CoAP client HOT 1
- Question on Root Resource
- Reject an exchange doesn't generate a RST paquet
- Identity and Key
- Setting MaxRetransmit in config has no effect HOT 1
- Multicast not working on the specified interface/IP
- Discover not Multicast Ready HOT 3
- CoapServer Crashes after some works
- Can we have source code of nuget CoAP.NET.Core HOT 2
- Unity Integration HOT 1
- Is Multicast implemented for server ?
- Docker Linux Container Support
- CoAP server download progress
- Disable well-known HOT 4
- hello,Just getting started with C#, I want to ask
- Mark and Sweep question
- CoAP.NET available documentation
- How to save CoAP server observable state in central memory for multiple server instances
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coap.net.