You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Andrew Denner (Jira)" <ji...@apache.org> on 2020/06/12 20:00:06 UTC

[jira] [Commented] (THRIFT-5232) .net Thrift nuget package TSocket(host,port) fails for all non local host connections

    [ https://issues.apache.org/jira/browse/THRIFT-5232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17134497#comment-17134497 ] 

Andrew Denner commented on THRIFT-5232:
---------------------------------------

The code with the TSocket(host,port) worked in version 0.9.3

> .net Thrift nuget package TSocket(host,port) fails for all non local host connections
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-5232
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5232
>             Project: Thrift
>          Issue Type: Bug
>          Components: netstd - Library
>    Affects Versions: 0.13.0
>         Environment: Windows 10, .net 4.5.1 project on visual studio 2019 version 6.3.5
> .net framework 4.8.03761
>            Reporter: Andrew Denner
>            Priority: Minor
>
> Using the .net nuget package ApacheThrift version 0.13.0.1 to connect to a hbase thrift2 thrift server running on a seperate machine TSocket(host,port) will fail with the error: 
>  
> {noformat}
> testhost.x86.exe Error: 0 : =============== Custom exception handling in HbasePortClient openAndGetScannerRowsCollection =============== testhost.x86.exe Error: 0 : Exception:  System.Net.Sockets.SocketException.
> testhost.x86.exe Error: 0 : FailCount:  1.
> testhost.x86.exe Error: 0 : Message:    A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
> testhost.x86.exe Error: 0 : StackTrace:    at System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port)
>    at Thrift.Transport.TSocket.Open()
>    at Thrift.Transport.TBufferedTransport.Open()
> {noformat}
>  
> For the following code:
> {code:java}
>                     socket = new TSocket(host, port);
>                     transport = new TFramedTransport(socket);
>                     transport.open();
>                     TCompactProtocol proto = new TCompactProtocol(transport);
>                     m_LazyClient = new THBaseService.Client(proto);
> {code}
> We tried with and without the open() command on the socket, transport etc.
> This however does work if you are connecting to localhost (via putty ssh port forwarding)
> As a workaround, the following code does work:
> {code:java}
>                     TcpClient cli = new TcpClient(host, port);
>                     socket = new TSocket(cli);
>                     transport = new TFramedTransport(socket);
>                     TCompactProtocol proto = new TCompactProtocol(transport);
>                     m_LazyClient = new THBaseService.Client(proto);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)