1
간단한 원격 Windows 서비스를 설치하려고 할 때 다음 오류가 발생합니다. 서비스 : 나는 "ONSTART"방법에 다음 코드를 Windows 서비스 응용 프로그램에서소켓의 예외 # 33711845 :: DoBind - 일반적으로 각 소켓 주소 (프로토콜/네트워크 주소/포트)의 한 가지 용도 만 허용됩니다.
System.Net.Sockets Error: 0 : [4180] Exception in the Socket#33711845::DoBind - Only one usage of each socket address (protocol/network address/port) is normally permitted
System.Net.Sockets Verbose: 0 : [4180] ExclusiveTcpListener#4032828::Start()
System.Net.Sockets Verbose: 0 : [4180] Socket#33711845::Bind(0:9998#9998)
System.Net.Sockets Error: 0 : [4180] Exception in the Socket#33711845::DoBind - Only one usage of each socket address (protocol/network address/port) is normally permitted
는 - 채널 등록 할 때 오류가 발생합니다 - ChannelServices.RegisterChannel (tcpPipe, true)를; 내가 아는 한 9998 포트를 사용하는 다른 프로세스는 없습니다 ...
protected override void OnStart(string[] args)
{
int portNumber = int.Parse(ConfigurationManager.AppSettings["endPointTCPPort"]);
TcpChannel tcpPipe = new TcpChannel(portNumber);
ChannelServices.RegisterChannel(tcpPipe, true);
Type serviceType = Type.GetType("TractionGatewayService.TractionGateway");
try
{
RemotingConfiguration.RegisterWellKnownServiceType(serviceType, "updateCustomerDetails", WellKnownObjectMode.SingleCall);
}
catch (RemotingException e)
{
EventLog.WriteEntry("unable to establish listening port because " + e.message;
ChannelServices.UnregisterChannel(tcpPipe);
}
가끔씩 Windows 서비스에서 remoting과 동일한 문제가 발생합니다. netstat -b를 실행하여 포트 소유 상태와 포트 상태를 확인하십시오. 제 경우, SYSTEM은 포트 상태가 'ESTABLISHED'인 소유자이고 해결 방법은 시스템을 다시 부팅하는 것입니다. – EventHorizon
안녕하세요, 귀하의 회신에 감사드립니다. netstat을 실행했지만 사용하려는 포트에 대한 언급이 없습니다 - 9998. "Windows 서비스"를 만들기 전에이 코드를 콘솔 창에서 실행하도록 작성했습니다. 포트 9998을 사용하여 콘솔 코드를 실행할 수 있습니다. 위의 코드를 Windows 서비스에서 실행할 때만이 오류가 발생합니다. 아마이 서비스를 내 워크 스테이션에 설치했다고 언급 했어야합니다. – wollemi
문제가 발견되어 기쁩니다. 이 기사를 읽는 다른 사람들에게 도움이되도록 .NET Remoting이 WCF를 위해 더 이상 사용되지 않습니다. –