We need an example of a code for simultaneous reception and data transmission through two web interfaces with TcpClient



  • Please provide an example of a code for simultaneous reception and data shipments through two web interfaces with assistance TcpClient

    Modivation: I need to balance requests through several web interfaces. For WebClient There's an op. ServicePoint.BindIPEndPointDelegate♪ but I didn't find a similar option ♪ TcpClient



  • I think you'll be fine. https://msdn.microsoft.com/en-us/library/3bsb3c8f.aspx ♪

    Examples of documentation:

    var ips = Dns.GetHostEntry(Dns.GetHostName()).AddressList;
    var localEndPoints = ips.Select(ip => new IPEndPoint(ip, port: 0));
    // как-то отфильтровать список
    var tcpClients = localEndPoints.Select(endPoint => new TcpClient(endPoint)).ToList();
    

    How to find which of the interfaces are relevant to the external connection is discussed https://stackoverflow.com/q/6803073/276994 ♪ (Because you can try to connect. http://www.google.com For testing, I guess.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2