简体   繁体   中英

Exception: System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:808

Getting an exception when I try to ping net.tcp listening failed

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools>svcutil 
net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex

Results:

Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.6.1055.0]
Copyright (c) Microsoft Corporation.  All rights reserved.

Attempting to download metadata from 'net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex' using WS-Metadata Exchange. This URL does not support DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.6.1055.0]
Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Cannot obtain Metadata from net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex

If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.


WS-Metadata Exchange Error
    URI: net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex

    Metadata contains a reference that cannot be resolved: 'net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex'.

    There was no endpoint listening at net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

If you would like more help, type "svcutil /?"

After rebooting the system and immediately executing below command would listen

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools>svcutil 
net.tcp://localhost/TNA/TAServices/AuthenticationManager/mex

Results:

Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.6.1055.0]
Copyright (c) Microsoft Corporation.  All rights reserved.

Attempting to download metadata from 'net.tcp://localhost/TNA/TAServices/AuthenticationManager' using WS-Metadata Exchange. This URL does not support DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.6.1055.0]
Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Cannot obtain Metadata from net.tcp://localhost/TNA/TAServices/AuthenticationManager

If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.


WS-Metadata Exchange Error
    URI: net.tcp://localhost/TNA/TAServices/AuthenticationManager

    Metadata contains a reference that cannot be resolved: 'net.tcp://localhost/TNA/TAServices/AuthenticationManager'.

    The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:04:59.9843782'.

    An existing connection was forcibly closed by the remote host

It wasn't overwritten by another process.

But below log shows it was overwritten by some other process not by SMSvcHost

An error occurred in the Activation Service 'NetTcpActivator' of the protocol 'net.tcp' while trying to listen for the site '1', thus the protocol is disabled for the site temporarily. See the exception message for more details.
 URL: WeakWildcard:net.tcp://username.domainname.com/
 Status: FailedToListen
 Exception: System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:808. This could happen if there is another application already listening on this endpoint or if you have multiple service endpoints in your service host with the same IP endpoint but with incompatible binding configurations. ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at System.ServiceModel.Channels.SocketConnectionListener.Listen()
   --- End of inner exception stack trace ---
   at System.ServiceModel.Channels.SocketConnectionListener.Listen()
   at System.ServiceModel.Activation.TransportListener.Go(IConnectionListener connectionListener)
   at System.ServiceModel.Activation.TransportListener..ctor(IPEndPoint endPoint)
   at System.ServiceModel.Activation.TransportListener.Listen(IPEndPoint endPoint)
   at System.ServiceModel.Activation.RoutingTable.TcpStart(MessageQueue messageQueue, BaseUriWithWildcard path)
   at System.ServiceModel.Activation.MessageQueue.Register(BaseUriWithWildcard path)
   at System.ServiceModel.Activation.ListenerAdapter.RegisterBindings(IActivatedMessageQueue queue, Int32 siteId, String[] bindings, String path)
 Process Name: SMSvcHost
 Process ID: 4608

web.config

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data" />
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
    <section name="dns" type="System.Configuration.NameValueFileSectionHandler" />
  </configSections>
  <dataConfiguration defaultDatabase="LocalSqlServer" />
  <dns file="dns.config" />
  <system.web>
    <!-- Web Part -->
    <membership>
      <providers>
        <clear />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" applicationName="/MVCFramework" />
      </providers>
    </membership>
    <profile enabled="true" defaultProvider="TableProfileProvider">
      <providers>
        <clear />
        <add name="TableProfileProvider" type="Microsoft.Samples.SqlTableProfileProvider" connectionStringName="LocalSqlServer" table="aspnet_Profile" applicationName="/MVCFramework" />
      </providers>
    </profile>
    <!-- End Web Part -->

    <pages validateRequest="false" enableEventValidation="false" enableViewStateMac="false" maintainScrollPositionOnPostBack="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <controls>
        <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit" />
      </controls>
    </pages>
    <customErrors mode="Off">
      <error statusCode="403" redirect="Status.aspx" />
      <error statusCode="404" redirect="Status.aspx" />
    </customErrors>
    <httpCookies httpOnlyCookies="true">
    </httpCookies>
    <trace enabled="false" localOnly="true">
    </trace>
    <httpRuntime maxRequestLength="2097151" executionTimeout="220000" requestValidationMode="2.0" />
    <!-- 
            Set compilation debug="false" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only  
            during development.
        -->
    <compilation debug="true" defaultLanguage="c#" targetFramework="4.0">
      <assemblies>
      </assemblies>
      <buildProviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      </buildProviders>
    </compilation>
    <sessionState mode="InProc" timeout="6000" cookieless="UseCookies">
    </sessionState>
    <authorization>
      <allow users="?" />
    </authorization>

    <httpHandlers>
      <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
      <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
    </httpHandlers>
  </system.web>
  <system.net>
    <settings>
      <servicePointManager expect100Continue="false" />
    </settings>
  </system.net>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="1024000000"></requestLimits>
      </requestFiltering>
    </security>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <remove name="ChartImageHandler" />
      <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </handlers>
    <modules>
      <add name="QueryStringValidation" type="Presentation.Utilities.QueryStringValidation" />
    </modules>
  </system.webServer>

  <system.data>
    <DbProviderFactories>
      <remove invariant="MySql.Data.MySqlClient" />
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.3.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_Framework" closeTimeout="00:50:00" openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:50:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="999999999" maxBufferPoolSize="524288" maxReceivedMessageSize="999999999" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="999999999" maxArrayLength="999999999" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None"/>
        </binding>
      </basicHttpBinding>
      <netTcpBinding>
        <binding name="NetTcpBinding_Framework" closeTimeout="00:50:00" openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:51:00" transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="999999999" maxBufferSize="999999999" maxConnections="10" maxReceivedMessageSize="999999999">
          <readerQuotas maxDepth="32" maxStringContentLength="999999999" maxArrayLength="999999999" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:50:00" enabled="false" />
          <security mode="None">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
   <client>
      <endpoint address="net.tcp://localhost/TNA/TAServices/AccountManager.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_Framework" contract="AccountManager.IAccountManager" name="NetTcpBinding_Framework" />
  </client>
    <behaviors>
      <endpointBehaviors>
        <behavior name="ClientBehavior">
          <dataContractSerializer maxItemsInObjectGraph="10000000" />
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>
  <location path="Common">
    <system.web>
      <authorization>
        <allow users="?" />
      </authorization>
    </system.web>
  </location>
  <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="5000000" />
      </webServices>
    </scripting>
  </system.web.extensions>
</configuration>

How should I need to configure windows and web.config file so that the process SMSvcHost would listen first after every boot. So that I wouldn't establish another listener by default by some other process on IP endpoint 0.0.0.0:808

As you know, NetTcp binding by default listens to the request on the 808 port. Therefore, please ensure the port 808 has not been used by another website when hosting the WCF service in IIS. Alternatively, we had better change another port in the site binding configuration.
WCF net.tcp binding 808:* what does this mean?
Besides, in order to support the NetTcp protocol in IIS, please refer to the below link.
Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Base address schemes are [http]
Finally, the configuration file of the WCF service doesn't support Nettcp protocol, we should add a service endpoint with NetTcpbinding so that it can work over NetTcp` protocol.
Feel free to let me know if there is anything I can help with.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM