You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Philip Lee (Jira)" <ji...@apache.org> on 2022/08/11 16:08:00 UTC

[jira] [Created] (THRIFT-5610) Help with inconsistencies in TSocketTransport (C#)

Philip Lee created THRIFT-5610:
----------------------------------

             Summary: Help with inconsistencies in TSocketTransport (C#)
                 Key: THRIFT-5610
                 URL: https://issues.apache.org/jira/browse/THRIFT-5610
             Project: Thrift
          Issue Type: Question
    Affects Versions: 0.16.0
         Environment: Windows 10.  Visual Studio 2022 17.3.
            Reporter: Philip Lee
         Attachments: Program.cs

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

 
{code:java}
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);{code}
 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)