Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractLicenceValidator - Socket Exception in the discoveryHost start method. #8

Open
madu020 opened this issue Jan 17, 2014 · 3 comments

Comments

@madu020
Copy link

madu020 commented Jan 17, 2014

In our project, we are testing the AbstractLicenceValidator.

We got an Exception with DiscoveryHost. It was a SocketException.
I have lost the stackTrace of the exception, but, i'm opening an issue to give you the solution that we applied in our project.

To resolve the problem, we have add a new constructor of AbstractLicenceValidator.
This constructor contain a boolean parameter that can enable or disable the discoveryhost.

There is the constructor :

    protected AbstractLicenseValidator(string publicKey, bool enableDiscovery = true)
    {
        LeaseTimeout = TimeSpan.FromMinutes(5);
        LicenseAttributes = new Dictionary<string, string>();
        nextLeaseTimer = new Timer(LeaseLicenseAgain);
        this.publicKey = publicKey;
        SetupDiscoveryHost(enableDiscovery);
    }

The Constructor call this Method :

    private void SetupDiscoveryHost(bool enableDiscovery)
    {
        DiscoveryEnabled = enableDiscovery;

        if (!enableDiscovery) return;

        senderId = Guid.NewGuid();
        discoveryHost = new DiscoveryHost();
        discoveryHost.ClientDiscovered += DiscoveryHostOnClientDiscovered;
        discoveryHost.Start();
    }

So.... In Conclusion, do you think that this solution can be add to your product ?

If yes, can you advise me when this new constructor will be available in the futur nuget package of Rhino.Licensing ?

Thanks to your team!

@vlow
Copy link
Contributor

vlow commented Feb 10, 2015

I can confirm this issue. It happens on a system with highly restrictive network settings.

Here is a stacktrace:

2015-02-10 14:39:05,301 [1] FATAL [ApplicationLoader]   Unhandled exception occurred:
System.Net.Sockets.SocketException (0x80004005): Ein ungültiges Argument wurde angegeben
    at System.Net.Sockets.Socket.setMulticastOption(SocketOptionName optionName, MulticastOption MR)
    at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
    at Rhino.Licensing.Discovery.DiscoveryHost.<SetSocketOptionsForNic>b__2(UnicastIPAddressInformation address)
    at System.Collections.Generic.List`1.ForEach(Action`1 action)
    at Rhino.Licensing.Discovery.DiscoveryHost.SetSocketOptionsForNic(NetworkInterface nic)
    at System.Collections.Generic.List`1.ForEach(Action`1 action)
    at Rhino.Licensing.Discovery.DiscoveryHost.BindUpAdaptersToMulticast()
    at Rhino.Licensing.Discovery.DiscoveryHost.Start()
    at Rhino.Licensing.AbstractLicenseValidator.SetupDiscoveryHost(Boolean enableDiscovery)
    at Rhino.Licensing.AbstractLicenseValidator..ctor(String publicKey, Boolean enableDiscovery)
    at Rhino.Licensing.LicenseValidator..ctor(String publicKey, String licensePath)
    at RandomApplication.Program.Main()

It happens on a German system, therefore the exception description is in German. It translates to: "An invalid argument has been given."

@vlow
Copy link
Contributor

vlow commented Feb 10, 2015

Hang on, I just realized that this is the wrong repo. The issue arises with the version from Nuget. But the version featured on Nuget is actually a fork made by Hadi Eskandari. This is the correct repo: https://github.com/hibernating-rhinos

@BlackBooth
Copy link

Has anynone found a solution for this? That error just occured to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants