Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5610

Inconsistent constructors TSocketTransport

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.16.0
    • 0.18.0
    • netstd - Library
    • None
    • Windows 10.  Visual Studio 2022 17.3.

    Description

      We have some software that communicates with a hardware device using Thrift.

      The software was until recently using Thrift 0.9.x (I know - old), and this worked fine.

      Thrift 0.16.0 worked fine when communicating over the office network but the code failed when communicating with the device over a second NIC where there was no DNS entry.  Thrift 0.9 was ok with this scenario.

      I've now got a workaround but the 3 constructors for TSocketTransport seem inconsistent. and could possibly work better. Details in the attached file.

      This is the gist

       

      var host = "xyz";
      var hostAddress = "192.168.1.109";
      var port = 9090;
      
      // NOTE: FailsNoSuchHost fails for an internal network to a hardware device
      // which doesn't have a DNS entry.  Nslookup returns nothing and DNS.GetHostEntry(...) throws
      
      // ok - there's no host entry so I guess this should fail
      await FailsNoSuchHost(host, port);
      
      // not ok - I'm specifying the IP explicitly, I don't expect this to fail
      await FailsNoSuchHost(hostAddress, port); 
      
      // this works by creating an IPAddress, but is inconsistent because
      // I have to explicity open the socket
      await CreateAddressSucceeds(hostAddress, port);
      
      // this works by creating a TcpClient, but I fails if I explicitly open the socket
      await CreateClientSucceeds(hostAddress, port);

       

       

      Attachments

        1. Program.cs
          4 kB
          Philip Lee

        Issue Links

          Activity

            People

              ImpPhil3 Philip Lee
              ImpPhil3 Philip Lee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h