[
https://issues.apache.org/jira/browse/THRIFT-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17580087#comment-17580087
]
Erik edited comment on THRIFT-5611 at 8/16/22 7:09 AM:
-------------------------------------------------------
attaching my client code (Python)
{code:java}
from tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers import ibrokers
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers.ttypes import
IBContract, NewsResponse
class TWSAPIThriftClient:
client_connection = None
def connect_to_thrift_server(self, tws_thrift_host="127.0.0.1",
ib_host_port=9090):
if self.client_connection is None:
# Make socket transport = TSocket.TSocket(tws_thrift_host, ib_host_port)
# Buffering is critical. Raw sockets are very slow transport =
TTransport.TBufferedTransport(transport)
# Wrap in a protocol protocol =
TBinaryProtocol.TBinaryProtocol(transport)
# Create a ibrokers_client to use the protocol encoder client =
ibrokers.Client(protocol)
# Connect! transport.open()
self.client_connection = client
return self.client_connection
if _name_ == "_main_":
temp_client = TWSAPIThriftClient()
temp_client = temp_client.connect_to_thrift_server()
result = temp_client.send_request_matching_symbols(['a', 'b'])
print()
{code}
result comes back `None` on client side
was (Author: emcp):
attaching my client code (Python)
{code:java}
import time
from tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers import ibrokers
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers.ttypes import
IBContract, NewsResponse
class TWSAPIThriftClient:
client_connection = None
def connect_to_thrift_server(self, tws_thrift_host="127.0.0.1",
ib_host_port=9090):
if self.client_connection is None:
# Make socket transport = TSocket.TSocket(tws_thrift_host, ib_host_port)
# Buffering is critical. Raw sockets are very slow transport =
TTransport.TBufferedTransport(transport)
# Wrap in a protocol protocol =
TBinaryProtocol.TBinaryProtocol(transport)
# Create a ibrokers_client to use the protocol encoder client =
ibrokers.Client(protocol)
# Connect! transport.open()
self.client_connection = client
return self.client_connection
if _name_ == "_main_":
temp_client = TWSAPIThriftClient()
temp_client = temp_client.connect_to_thrift_server()
result = temp_client.send_request_matching_symbols(['a', 'tsla'])
print()
{code}
result comes back `None` on client side
> v0.16.0 C++ servers suddenly giving brokenpipe errors
> -----------------------------------------------------
>
> Key: THRIFT-5611
> URL: https://issues.apache.org/jira/browse/THRIFT-5611
> Project: Thrift
> Issue Type: Bug
> Components: C++ - Library
> Affects Versions: 0.16.0
> Reporter: Erik
> Priority: Major
>
> I jumped from v0.15.0 to v0.16.0 .. and trying to track down what could cause
> this response in my C++ Server
>
> {code:java}
> Thrift: Mon Aug 15 22:11:54 2022 TSocket::write_partial() send() <Host:
> 127.0.0.1 Port: 58998>: Broken pipe
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient died: write() send():
> Broken pipe
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient output close failed: Called
> write on non-open socket
> {code}
>
> my server code is unchanged and was previously okay, I think.. I will keep
> debugging and trying to ensure it's not me but.. can anyone clue me in on how
> to repair this ? or what to look for?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)