You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (Jira)" <ji...@apache.org> on 2022/09/14 21:53:00 UTC

[jira] [Resolved] (THRIFT-5610) Inconsistent constructors TSocketTransport

     [ https://issues.apache.org/jira/browse/THRIFT-5610?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jens Geyer resolved THRIFT-5610.
--------------------------------
    Fix Version/s: 0.18.0
       Resolution: Fixed

> Inconsistent constructors TSocketTransport
> ------------------------------------------
>
>                 Key: THRIFT-5610
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5610
>             Project: Thrift
>          Issue Type: Improvement
>          Components: netstd - Library
>    Affects Versions: 0.16.0
>         Environment: Windows 10.  Visual Studio 2022 17.3.
>            Reporter: Philip Lee
>            Assignee: Philip Lee
>            Priority: Minor
>             Fix For: 0.18.0
>
>         Attachments: Program.cs
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)