Microsoft MVP성태의 닷넷 이야기
WCF net.tcp 관련해서 질문 드립니다. [링크 복사], [링크+제목 복사],
조회: 21619
글쓴 사람
김응규 (elther at nate.com)
홈페이지
첨부 파일
 


 안녕하세요.

 WCF net.tcp를 이용해서 간단하게 프로젝트를 진행해보려고 하는데

 설정 단계에서 막혀버려서 답답합니다.


 서비스와 클라이언트가 한 컴퓨터 안에서 돌아갈때는 문제 없이 잘 돌아가는데

 서비스를 서버에 올리고 외부에서 붙으려고 하면

 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 소켓 연결이 중단되었습니다. 메시지 처리 오류 또는 원격 호스트에 의한 수신 시간 제한 초과, 또는 기본 네트워크 리소스 문제 때문일 수 있습니다. 로컬 소켓 시간 제한은 '00:00:09.9945955'입니다.

 
 이런 메세지가 나옵니다.

 어제는 10060 에러가 발생해서 호스팅 업체를 통해 포트를 열었는데, 그 후 잘될줄 알았으나.. 10060 에러는 사라지고 소켓 연결 에러가 나오네요..


 server config
 ----------------------------
 <?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="HelloWorldService.HelloWorldWCFService">
        <endpoint address="http://내 도메인/helloworld.svc" binding="basicHttpBinding"
          bindingConfiguration="" contract="HelloWorldService.IHelloWorld" />
        <endpoint address="net.tcp://내 도메인/HelloWorld.svc" behaviorConfiguration="endpointBehavior"
          binding="netTcpBinding" bindingConfiguration="tcpBinding" name="hellonettcpbinding"
          contract="HelloWorldService.IHelloWorld">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" behaviorConfiguration="endpointBehavior" binding="mexTcpBinding"
          bindingConfiguration="" name="mextcpbinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://내 도메인/HelloWorld.svc" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="endpointBehavior">
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
      multipleSiteBindingsEnabled="true" />
    <bindings>
      <netTcpBinding>
        <binding name="tcpBinding" receiveTimeout="00:01:30" >
          <security mode="None"/>
          <reliableSession enabled="true" inactivityTimeout="00:00:10" ordered="true" />
        </binding>
      </netTcpBinding>
    </bindings>
  </system.serviceModel>
  <system.diagnostics>
    <trace autoflush="true" />
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="sdt"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData="SdrConfigExample.e2e" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
</configuration>


 
 client config
 -----------------------
 <?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        
        <behaviors>
            <endpointBehaviors>
              <behavior name="endpointBehavior">
                <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
              </behavior>
            </endpointBehaviors>
        </behaviors>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IHelloWorld" />
            </basicHttpBinding>
            <netTcpBinding>
              <binding name="NetTcpBinding_IHelloWorld">
                <security mode="None"/>
                <reliableSession enabled="true" inactivityTimeout="00:00:10" ordered="true" />
              </binding>
            </netTcpBinding>
        </bindings>
        <client>
            <endpoint address="http://내 도메인/HelloWorld.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IHelloWorld" contract="ServiceReference1.IHelloWorld"
                name="BasicHttpBinding_IHelloWorld" />
            <endpoint address="net.tcp://내 도메인/HelloWorld.svc" binding="netTcpBinding"
                bindingConfiguration="NetTcpBinding_IHelloWorld" contract="ServiceReference1.IHelloWorld"
                name="NetTcpBinding_IHelloWorld">
                <identity>
                    <servicePrincipalName value="host/WIN2012-STD" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>

  <system.diagnostics>
    <trace autoflush="true" />
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="sdt"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData="SdrConfigExample.e2e" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
</configuration>




 후움.. 원인이 무엇일까요 ㅠㅠ.. 거의 다 온것 같은데..
 








[최초 등록일: ]
[최종 수정일: 4/22/2015]


비밀번호

댓글 작성자
 



2015-04-22 02시32분
사이트에 올라와있는 WCF 관련글들을 쭉 읽어보니 결국 인증 문제인것 같은데, 인증서로 인증부분을 처리해야 하나요?
김응규
2015-04-22 04시42분
security mode="None"으로 설정했기 때문에 인증 문제는 아닙니다. 인증서도 필요없을 것 같고요. 글쎄요... 그냥 봐서는 별다르게 문제가 없어 보이는데요. 단지, 에러 메시지에 보인 00:00:09.9945955 숫자가 걸리는데, 혹시 연결이 안되는 건가요? 아니면 연결은 되었는데 조금 있다가 끊기는 건가요?
정성태

[1]  2  3  4  5  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
5968orion4/30/2025175winform DataSet.xsd의 암호화 된 ConnectionString 사용 질문 [1]
5966GM B4/30/2025190C#과 python 연동 질문 [1]
5962SunN...4/21/2025534Contextmenu margin 조절 [1]파일 다운로드2
5961GM B4/10/2025937winform => wpf 마이그레이션 방법 질문 [4]파일 다운로드1
5960Kim ...4/9/20251183안녕하세요.. 혹 AI & C# 에 대해서도 다루시나요? [1]
5959vict...2/10/20251881비주얼 스투디오 CLR 코드 탑색 질문입니다. [1]
5958Supe...1/18/20252862C#으로 DLL을 만들때 WebVeiw2을 이용하여 Vb6에서 사용할수 있는지 문의드립니다. [2]
5956fc1/11/20252858한국투자증권 KIS Developers OpenAPI의 C# 래퍼 버전 - eFriendOpenAPI NuGet 패키지 [1]
5955tree...11/8/20244508C#12 책 179 페이지 문의 사항 [2]
5954SunN...10/10/20244974textbox에서 글자입력후 textBox1_KeyUp함수에서listBox1_SelectedIndexChanged 강제호출방법 [1]
5953Roya10/4/20244933c# com host dll을 c++에서 사용할 때, sdk 관련 runtime 을 설치 안하고 제공할수 있을까요?? [1]
5952우광현9/5/20246073서버용 소켓 포트 동적포트 적용시 클라이언트가 호출하는 방법? [2]
5951Kun ...8/21/20245682c++에서 복합데이터 Struct를 .NET Framework에서 구현할 수 있는 방법이 있을까요? [2]
5950SunN...8/18/20246240정석대로 한다면 response.Close() 해야되는지요? [4]
5949SunN...8/16/20246329SqlConnection Open()에서 에러가나면 Close()하는 시점 [3]
5948SunN...8/14/20246206WebRequestMethods.Ftp.MakeDirectory 해제 [3]
5947Roya8/7/20246986c# dll을 cpp lib에서 사용을 할려고 하는데요. CoCreateInstance 에서 지정된 파일을 찾을수 없다고 나오는대요. [4]
5946SunN...8/5/20247092TaskDefinition 에서 사용저가로그온상관없이실행 [3]파일 다운로드1
5945SunN...8/3/20246959윈도우 작업스케줄러 [1]
5944roya8/1/20246902C# dll을 C++ 프로젝트에서 사용을 하고 싶은데, 레지스트리 등록 없이 가능한걸까요?? [2]
5943SunN...8/1/20246766윈도우C#에서 리눅스FTP로 업로드 및 리눅스에 폴더생성(WindowsOS에서C#으로) [3]
5942vict...7/24/20246810dll 을 c#에서 쓰고 싶습니다 [1]
5941vict...7/17/20248293DependencyObject와 같은 스레드에서 DependencySource를 만들어야 합니다. 오류 [2]
5940ckm7/16/20248709선생님 안녕하세요 async await 교착 관련 질문입니다 [1]
5939괴물신인7/9/20248412템플릿 대체할수있는방법이 있을까요? [6]
[1]  2  3  4  5  6  7  8  9  10  11  12  13  14  15  ...