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>
netTcpBinding
とbasicHttpBinding
とまったく同じ2と2つのエンドポイントがあります。
問題は、私はnetTcpBinding
エンドポイントを使用しようとしているとき、私はエラーを取得しています表示されますが、basicHttpBinding
と、それが正常に動作します...
私はでWCFサービスをホストしていますコンソールアプリケーション。
プログラムコード
ServiceHost authenticationHost = new ServiceHost(typeof(AuthenticationService));
authenticationHost.Open();
Console.WriteLine("close <ENTER>\n");
Console.ReadLine();
authenticationHost.Close();
たぶん誰かが同様の問題に直面しましたか?必要に応じて
は、私が
は、事前にありがとう、すべての必要な追加情報を与えるでしょう!
例外により、tcpリスナーでエラーが発生しています。リスナーはIPアドレスを聞くべきではありません。エンドポイントIPを聞く必要があります。 – jdweng
@jdweng、例を挙げてください。 – kotki
ウェブページをご覧ください: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