-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Spike: SocketException: Address already in use when running on Ubuntu #22
Comments
It looks like Could you stop the daemon and try again? |
Hi @richardschneider thanks for your swift reply. I figured it would be an issue related to either
If the comment above was true, then Could it be possible that the issue has to do with the .NET socket not actually setting the |
You could be right. I seem to remember some issues with .Net sockets and socket options. |
I see, do you happen to have any clues on how we could resolve it? |
@gaviriar Take a look at this code. It appears that I have no idea how to fix this, except to report a bug. For some background info see https://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t |
@richardschneider you can have a look into this, might be usefull: https://github.com/QTimort/bind-reuse-port |
Thanks @QTimort it does look interesting. Its been a few years (may a decade or so) since I worked with C and *nix, so please be forgiving with these newbie/oldie questions.
|
|
Hi @richardschneider, just a quick update on some testing that has been done (mainly by @QTimort ). It seems to be that this issue does not occur if you happen to have the .NET core 2.0 installation on your target Ubuntu machine. Whereas when using a .NET core 2.1 installation this issue persists. Therefore there must be some difference between the two versions which causes this on 2.1 :( Do you happen to know if this will be taken care of in any later releases .NET core? |
Hey @richardschneider this should be fixed by dotnet/corefx#32046 |
@QTimort thanks for the information. I guess we must wait for .NET Core 2.2 to verify everything is working. |
Testing this issue further I discovered that the error 'Address already in use':
is still present in .NET Core 2.2 (hovewer this problem is prevalent in all project of similar nature), but the code is running on .Net Core 3.0 Preview. (Not sure the functionality is 100%.) Can someone confirm? Tested on Debian Stretch (up to date) with rt-preempt and avahi running. BTW: Edit:
|
@cerna wow, thanks for the detailed analysis! I was hoping that the next release of .Net Core would fix this.
Yes, PR #40 introduced a bug that make the Circile CI tests fail for .Net Core 1.1. These tests are run on a Debian GNU platform. In the previous code the setting of the socket was only done when running on Windows. |
A new library allows setting raw socket values. Maybe it will help. https://github.com/tmds/Tmds.LibC |
Some Linux .Net Core implementations do correctly set the SO_REUSEADDR socket option. This is needed so that other apps, such as avahi or chrome, can also do multicast DNS. [Tmds.LibC](https://github.com/tmds/Tmds.LibC) is used to set the bit.
Some Linux .Net Core implementations do not correctly set the SO_REUSEADDR socket option. This is needed so that other apps, such as avahi or chrome, can also do multicast DNS. Tmds.LibC is used to set the bit. |
Hi There,
I was testing the Spike sample application on Linux, the code builds but when I try to run it I get the following exception:
Built On
OS: Ubuntu 18.04
cli version: .NET Command Line Tools (2.1.302)
dotnet version: netcoreapp2.0
Just some additional information, it seems that the exception is thrown here when trying to bind to the MultiCast port 5353. When checking the list of processes that own port 5353
sudo lsof -i :5353
I get the following output:Any clues or suggestions why this might be the case? Secondly, do you plan to provide support on linux for this library?
Regards,
Ricardo
The text was updated successfully, but these errors were encountered: