Skip to content

Listener Exception : Only one usage of each socket address (protocol/network address/port) is normally permitted. |modules.http-server| #111

@MRIIOT

Description

@MRIIOT

In my application I have an instance of two classes. This exception only occurs when both classes are instantiates within my application.

// MTConnectMqtt.cs
protected override bool CreateImplementation()
    {
        _client = new MTConnectAgentApplication();
        return true;
    }

    protected override bool ConnectImplementation()
    {
        _client.StartAgent(new AgentApplicationConfiguration() { 
            Modules = new []
            {
                new Dictionary<object, object> ()
                {
                    {"mqtt-relay", new Dictionary<object, object>()
                    {
                        {"server", Configuration.Address},
                        {"port", Configuration.Port},
                        {"timeout", 10000},
                        {"clientId", Properties.GetProperty<string>("client_id")},
                        {"topicPrefix", "MTConnect"},
                        {"topicStructure", "Document"},
                        {"currentInterval", 10000},
                        {"sampleInterval", 500},
                        {"documentFormat", "json-cppAgent"}
                    }}
                }
            }
        }, true);
        
        return true;
    }

and

// MTConnectAgent.cs
protected override bool CreateImplementation()
    {
        _client = new MTConnectAgentApplication();
        return true;
    }

    protected override bool ConnectImplementation()
    {
        _client.StartAgent(new AgentApplicationConfiguration() { 
            Modules = new []
            {
                new Dictionary<object, object> ()
                {
                    {"http-server", new Dictionary<object, object>()
                    {
                        {"port", Configuration.Port},
                    }}
                }
            }
        });
        
        return true;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions