WCF TCP 연결이 지속되지 않는 것처럼 보입니다. 첫 번째 ping 응답은 시간이 좀 걸리지 만 후속 프로세스는 더 적은 시간이 걸립니다. 잠시 후 다시 오래 걸립니다 - 다른 재 연결?영구 TCP 연결을 만들고 시뮬레이트하는 방법은 무엇입니까?
SERVER> Started on net.tcp://0.0.0.0:999
CLIENT> Connection created to net.tcp://localhost:999 //Not a real connection, ready to connect
CLIENT> Ping reply in 1s163ms //First connection
CLIENT> Ping reply in 22ms //Already connected
CLIENT> Ping reply in 26ms
CLIENT> Ping reply in 24ms
CLIENT> Ping reply in 325ms //Re-connected
CLIENT> Ping reply in 19ms
CLIENT> Ping reply in 767ms //Re-connected
사실이라면 tcp 연결이 끊어지기 전에 유휴 시간 값은 얼마입니까? 연결을 유지해야합니다.
업데이트 수정 된 코드 :
NetTcpBinding tcpBind = new NetTcpBinding();
tcpBind.ReliableSession.Enabled = true;
tcpBind.ReliableSession.Ordered = true;
tcpBind.ReliableSession.InactivityTimeout = TimeSpan.FromMinutes(10);
ServiceHost svh = new ServiceHost(typeof(ServiceImplementation));
svh.AddServiceEndpoint(
typeof(WCFSimple.Contract.IService),
//new NetTcpBinding(),
tcpBind,
String.Format("net.tcp://{0}:{1}", ip, port));
svh.Open();
가 지금은 또 다른 오류가 발생했습니다 :
The action http://tempuri.org/IService/Pong is not supported by this endpoint. Only WS-ReliableMessaging February 2005 messages are processed by this endpoint.
업데이트는 난 단지 서버 측 수정과 오류를 일으켰습니다. 그런 다음 클라이언트 쪽의 TCP를 신뢰할 수있는 메시징으로 수정했습니다.
실제 테스트 : 3 초 간격으로 ping 응답은 ~ 100ms입니다. 간격이 60이면 응답은 ~ 500ms이고 1s520ms (재 연결 가능)가됩니다. –
시간 초과를 활성화해야한다고 생각합니다 : reliableSession> enable = true; inactivityTimeout = 10s; –