使用remoting时候.客户端多网卡回调事件调用异常怎么解决?
主机只有一个网卡,客户机器多个网卡,服务器回调客户端时异常
注意是客户端多网卡 不是服务器
服务器配置:
服务端 ipconfig:
服务端回调
网上查找的资料都是配置服务端的多个网卡,那怎么解决客户端多网卡,回调异常呢?
客户端是存在 ip: 172.27.35.1
发生了 System.Reflection.TargetInvocationException
Message=调用的目标发生了异常。
Source=mscorlib
StackTrace:
在 System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
在 System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
在 System.Delegate.DynamicInvokeImpl(Object[] args)
在 System.Delegate.DynamicInvoke(Object[] args)
在 Com.IComm.HLClientRegiste.hlDispatchMsg(clsUserInfo lgstatus) 位置 D:\Code\******\******\******\User\******.vb:行号 30
InnerException: System.Net.Sockets.SocketException
ErrorCode=10061
Message=由于目标机器积极拒绝,无法连接。 172.27.35.1:3057
NativeErrorCode=10061
Source=mscorlib
StackTrace:
Server stack trace:
在 System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
在 System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
在 System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)
在 System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
在 System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
在 System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
在 System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
在 System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
在 System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 Com.IComm.clsbetween.hlDispatchMsg(clsUserInfo lgstatus)
InnerException:
注意是客户端多网卡 不是服务器
服务器配置:
服务端 ipconfig:
C:\Documents and Settings\****>ipconfig
Windows IP Configuration
Ethernet adapter 本地连接 2:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.2.133
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.2.1
Dim serverProvider As New BinaryServerFormatterSinkProvider
Dim clientProvider As New BinaryClientFormatterSinkProvider()
serverProvider.TypeFilterLevel = TypeFilterLevel.Full
Dim props As IDictionary = New Hashtable()
props("port") = port
props("bindTo") = "192.168.2.133"
props("useIpAddress") = True
props("machineName") = "xxx.******" ' 这里填写后,在客户机器上面修改host
'props("rejectRemoteRequests") = False
RemotingConfiguration.CustomErrorsMode = False
Dim Tcp As New TcpChannel(props, clientProvider, serverProvider)
ChannelServices.RegisterChannel(Tcp, False)
服务端回调
Public Sub hlDispatchMsg(ByVal lgstatus As clsUserInfo)
If (Not IsNothing(hldir) AndAlso hldir.Count > 0) Then
Com.****.Util.PrintErrorHandle("客户端个数" & hldir.Count)
For i As Integer = hldir.Count - 1 To 0 Step -1
Dim ky As String = hldir.Keys(i)
Dim p As System.Delegate = hldir.Values(i)
Try
p.DynamicInvoke(lgstatus) '这里抛出上面的那个异常
Com.****.Util.PrintErrorHandle("分发" & ky)
Catch ex As Exception
hldir.Remove(ky)
Com.****.Util.PrintErrorHandle("异常" & ky)
Com.****.Util.PrintErrorHandle(ex.Message & vbCrLf & ex.StackTrace)
End Try
Next
End If
End Sub
网上查找的资料都是配置服务端的多个网卡,那怎么解决客户端多网卡,回调异常呢?
客户端是存在 ip: 172.27.35.1
...全文
相关推荐
Qt多网卡组播问题解决方法
Qt组播实现起来比较简单,基本步骤是先绑定IP地址和端口,然后加入组播组,将网卡数据准备完成信号与一个数据接收处理的槽函数连接即可。但是如果计算机上多于两块网卡,就必须再增加两个步骤才行:使用setMulticastInterface设置组播网卡,然后加入组播的同时指定网卡joinMulticastGroup(groupAddr, lni[nIndex])。否则的话向组播地址发送数据时,对端的服务器程序就无法接收到数据。
Remoting事件经典例子(服务器客户端相互调用实例)
Remoting 经典例子(服务器 客户端 相互调用实例),我就是学这个入门的,资源共享
Remoting支持内外网同时使用实例
此实例重点描述了Remoting如何同时支持内外网使用。也描述了初始化TcpChannel通道的多种方式。这些资源在网络都容易找到。重要的实现是:重写MarshalByRefObject类的CreateObjRef方法,动态指定生成代理对象的远程地址。已解决外网调用创建的远程实例是内网地址的问题。
中兴多网卡客户端Luzj_ZTE
支持中兴多网卡登陆,不怕掉线,结合魔方优化大师可以实现fiwi共享
支持多网卡的锐捷客户端(华中科技大学的上网端)
可以支持多网卡的锐捷客户端,解决了原来的不支持多网卡,是华中科技大学的上网必备软件。 如果安装后显示未发现网卡请下载winpcap并安装。


