2016-10-08 5 views
2

net.tcpエンドポイントを使用してWCFサービスを起動する際に問題があります。私は10049エラーが発生しています。net.tcpバインディングエラーでサービスを起動できない10049

マイapp.config

<system.serviceModel> 
    <services> 
     <service behaviorConfiguration="ServiceBehaviour0" 
       name="Tinkl.Server.Services.Authentication.AuthenticationService"> 
      <endpoint name="httpEndpoint" 
       address="reg" 
       binding="basicHttpBinding" 
       contract="Tinkl.Server.Services.Authentication.IRegistrationService" /> 
      <endpoint name="httpEndpoint" 
       address="auth" 
       binding="basicHttpBinding" 
       contract="Tinkl.Server.Services.Authentication.IAuthorizationService" /> 
      <!-- 
      <endpoint name="tcpEndpoint" 
       address="net.tcp://78.26.210.203:50050/reg" 
       binding="netTcpBinding" 
       contract="Tinkl.Server.Services.Authentication.IRegistrationService" /> 
      <endpoint name="tcpEndpoint" 
       address="net.tcp://78.26.210.203:50051/auth" 
       binding="netTcpBinding" 
       contract="Tinkl.Server.Services.Authentication.IAuthorizationService" /> 
       --> 
      <endpoint name="mexEndpoint" 
       address="mex" 
       binding="mexHttpBinding" bindingConfiguration="" 
       contract="IMetadataExchange" /> 
      <host> 
       <baseAddresses> 
        <add baseAddress="http://78.26.210.203:50076/" /> 
       </baseAddresses> 
      </host> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
      <behavior name="ServiceBehaviour0"> 
       <!--<serviceMetadata />--> 
       <serviceMetadata httpGetEnabled="true" /> 
       <serviceDebug includeExceptionDetailInFaults="True" /> 
      </behavior> 
     </serviceBehaviors> 
    </behaviors> 

netTcpBindingbasicHttpBindingとまったく同じ2と2つのエンドポイントがあります。

問題は、私はnetTcpBindingエンドポイントを使用しようとしているとき、私はエラーを取得しています表示されますが、basicHttpBindingと、それが正常に動作します...

enter image description here

私はでWCFサービスをホストしていますコンソールアプリケーション。

プログラムコード

ServiceHost authenticationHost = new ServiceHost(typeof(AuthenticationService)); 
authenticationHost.Open(); 

Console.WriteLine("close <ENTER>\n"); 

Console.ReadLine(); 
authenticationHost.Close(); 

たぶん誰かが同様の問題に直面しましたか?必要に応じて

は、私が

は、事前にありがとう、すべての必要な追加情報を与えるでしょう!

+0

例外により、tcpリスナーでエラーが発生しています。リスナーはIPアドレスを聞くべきではありません。エンドポイントIPを聞く必要があります。 – jdweng

+0

@jdweng、例を挙げてください。 – kotki

+0

ウェブページをご覧ください:http://stackoverflow.com/questions/32181993/how-to-create-a-wcf-that-listens-to-tcp-requests-over-webおそらくプログラムコードがリスナーを起動しています。ソケットコードの例については、次を参照してください。ソケットの代わりにTCPListenerのようなソケットを継承するクラスを使用できます。https://msdn.microsoft.com/en-us/library/w89fhyex(v=vs.110).aspx – jdweng

答えて

3

net.tcp://localhost:50050/reg 

そして/authエンドポイントで同じでライン

net.tcp://78.26.210.203:50050/reg 

を交換してください。

関連する問題