远程处理配置失败,但例外情况:尝试以其访问权限禁止的方式访问套接字

时间:2014-08-27 06:18:57

标签: c# .net sockets remoting

我已在我的代码中添加了Dot net remoting支持(以下代码和App.config,其中包含远程处理配置)

。 。

  RemotingConfiguration.Configure("App.Config", false);

。 。 。 App.config中

    <!-- This channel uses GTCP from Genuine Channel, client application must use this channel access. /!-->
    <channel type="Belikov.GenuineChannels.GenuineTcp.GenuineTcpChannel, GenuineChannels" MaxTimeSpanToReconnect="240000" ReconnectionTries="0" port="8080">

。 。 。 。

我看到异常

  

远程处理配置因异常而失败   &#39; System.Reflection.TargetInvocationException:异常已经发生   由调用目标抛出。 ---&GT;   System.Net.Sockets.SocketException:试图访问a   套接字以其访问权限禁止的方式

     

在System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot,   SocketAddress socketAddress)

     

在System.Net.Sockets.Socket.Bind(EndPoint localEP)

     

在   Belikov.GenuineChannels.GenuineTcp.TcpConnectionManager.StartListening(对象   endPointAsObject)

     

在   Belikov.GenuineChannels.GenuineTcp.GenuineTcpChannel.StartListening(对象   数据)

     

在   Belikov.GenuineChannels.GenuineTcp.GenuineTcpChannel..ctor(IDictionary的   属性,IClientChannelSinkProvider iClientChannelSinkProvider,   IServerChannelSinkProvider iServerChannelSinkProvider)

     

---内部异常堆栈跟踪结束---

     

在System.RuntimeMethodHandle._InvokeConstructor(Object [] args,   SignatureStruct&安培;签名,IntPtr声明类型)

     

在System.RuntimeMethodHandle.InvokeConstructor(Object [] args,   SignatureStruct签名,RuntimeTypeHandle声明类型)

     

在System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags   invokeAttr,Binder binder,Object []参数,CultureInfo文化)

     

在System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,   Binder binder,Object [] args,CultureInfo culture,Object []   activationAttributes)

     

在System.Activator.CreateInstance(Type type,BindingFlags   bindingAttr,Binder binder,Object [] args,CultureInfo culture,   Object [] activationAttributes)

     

在   System.Runtime.Remoting.RemotingConfigHandler.CreateChannelFromConfigEntry(ChannelEntry   条目)

     

在   System.Runtime.Remoting.RemotingConfigHandler.ConfigureChannels(RemotingXmlConfigFileData   configData,Boolean ensureSecurity)

     

在   System.Runtime.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXmlConfigFileData   configData,Boolean ensureSecurity)&#39;。

我有点困惑,因为之前使用得很好,相同的代码给我一个错误。

任何人都可以帮我弄清楚这里出了什么问题。

1 个答案:

答案 0 :(得分:0)

我将端口ID从8080更改为62388

    

它解决了我的问题。但仍然无法弄清楚为什么它给我8080的错误