Hi!
I've got a windows forms app (.net 2). In the constructor of the main form I'm trying to set up an object to be remoted over a server tcp channel. I'm only interested in sharing the object with other apps on the same machine.
i.e.
it throws a SocketException on the line that creates the new TcpServerChannel, but I've got pretty much identical code working in another exe!?
Here are the exception details:
Message - "No such host is known" {System.Net.Sockets.SocketException}
ErrorCode - 11001
SocketErrorCode - HostNotFound {System.Net.Sockets.SocketError}
Source - "System"
StackTrace:
"at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineName()
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineIp()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupMachineName()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(String name, Int32 port, IServerChannelSinkProvider sinkProvider)
at Namespace.MainForm..ctor(Mutex sync, Int32 nPortNo)"
The 'ErrorCode' is supposed to be the native error number, but the message isn't any different & after looking into it I'm still pretty stuck. Why would i get host resolution problems? esp. when it's working in another exe with the same code!!
I'm gonna carry on with it & see what I can come up with, but if anyone can help I'd really appreciate it!
Thanks!
I've got a windows forms app (.net 2). In the constructor of the main form I'm trying to set up an object to be remoted over a server tcp channel. I'm only interested in sharing the object with other apps on the same machine.
i.e.
Code:
InitializeComponent();
try
{
_iview = new iView(this);
BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
[b]_channel = new TcpServerChannel("tcpIntegrationViewServer", nPortNo, provider);[/b]
ChannelServices.RegisterChannel(_channel, false);
_proxy = RemotingServices.Marshal(_iview, "Namespaces.iView");
it throws a SocketException on the line that creates the new TcpServerChannel, but I've got pretty much identical code working in another exe!?
Here are the exception details:
Message - "No such host is known" {System.Net.Sockets.SocketException}
ErrorCode - 11001
SocketErrorCode - HostNotFound {System.Net.Sockets.SocketError}
Source - "System"
StackTrace:
"at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineName()
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineIp()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupMachineName()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(String name, Int32 port, IServerChannelSinkProvider sinkProvider)
at Namespace.MainForm..ctor(Mutex sync, Int32 nPortNo)"
The 'ErrorCode' is supposed to be the native error number, but the message isn't any different & after looking into it I'm still pretty stuck. Why would i get host resolution problems? esp. when it's working in another exe with the same code!!
I'm gonna carry on with it & see what I can come up with, but if anyone can help I'd really appreciate it!
Thanks!