[EN] PC with multihome network (solved)

Topics: Technical Support
Sep 22, 2015 at 8:00 PM
Edited Sep 22, 2015 at 8:00 PM
I try create project with Zyan
On my PC
System.Net.IPAddress[] addresses =   System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName());
addresses contains 3 addresses
[0]: {::1}
[1]: {169.254.80.80}
[2]: {192.168.166.101}
How I can specify concrete IP address for code:
    m_ProtocolSetup = new TcpCustomServerProtocolSetup ( 8080, new NullAuthenticationProvider(), true);
      m_Host = new ZyanComponentHost(hostname, m_ProtocolSetup);
This code always use [1]: {169.254.80.80} address.
Coordinator
Sep 22, 2015 at 10:54 PM
Hi,
 
This code always use [1]: {169.254.80.80} address
 
Please explain what do you mean by «always use».

Tcp channel binds to all available network interfaces, so you can connect to server using any of these addresses.
If you need to listen on an exact interface, Tcp channel can be instructed to do so using ChannelSettings property:
protocolSetup.ChannelSettings["bindTo"] = "192.168.166.101";
Regards, Alex
Marked as answer by yallie on 9/23/2015 at 11:49 PM