Problems using Qt5 and Apache Thrift

PAULUS, Raimund, TI-ABN Raimund.Paulus@dillinger.biz
Thu Mar 26 06:59:03 GMT 2020


Hello Andrey Repin

The sources and the documentation are her:

https://thrift.apache.org/tutorial/cpp

You must have libthrift installed.

Maybe using threads is a better programming style, but i don't know, if it solves the problem. I use connecting and disconnecting to the service like braces around the rest of the application. At some points the application transfers data to the service and expects an answer. It is a synchronous communication and i use it like RPC (remote procedure call). The client sends a request and the service has to respond. Without the response the client cannot continue. Every client has its own service.

Greetings

Ramund Paulus

> -----Ursprüngliche Nachricht-----
> Von: Andrey Repin [mailto:anrdaemon@yandex.ru]
> Gesendet: Mittwoch, 25. März 2020 12:13
> An: PAULUS, Raimund, TI-ABN; cygwin@cygwin.com
> Betreff: Re: Problems using Qt5 and Apache Thrift
> 
> Greetings, PAULUS, Raimund, TI-ABN!
> 
> > Problems using Qt5 and Apache Thrift
> 
> ...snip...
> 
> > Now i want to implement the interface parts with Qt 5. Here is the new program
> sequence:
> 
> > //------------------------------------------------------------------------------
> > program starts
> > step 1: make the connection to the Linux server (Apache Thrift)
> > step 2: initialize Qt interface (create widgets, buttons, ...)
> > step 3: user interface (Qt)
> > step 4: data transfer PC <-> Linux-Host (Apache Thrift)
> > step 5: user interface (Qt)
> > step 6: data transfer PC <-> Linux-Host (Apache Thrift)
> > ...
> > ...
> > ...
> > step n-1: end Qt app
> > step n: close the connection to the host (Apache Thrift)
> > program ends
> > //------------------------------------------------------------------------------
> 
> > During step 2 the connection to the linux server is broken. You can see it
> > with the netstat command. First error message arises in step 4:
> 
> > "TSocket::write_partial() send() <Host: my_host Port: 9090>Broken pipe"
> 
> I strongly suggest placing communication service in its own thread.
> Then you could manage connection without having to worry about blocking
> timeouts caused by GUI operations.
> They will run asynchronously.
> 
> > On a Linux box the client program runs perfectly.
> 
> Only by coincidence, I suppose.
> 
> > On the windows box the program works, if i initalize Qt before the
> > connection to the server is made (step 2 before step 1). But that is not
> > acceptable for me, because afterwards other widgets and buttons are created
> > and i can not close and create the connection at each point.
> 
> I suppose, the server dropping connection by timeout. But I'd urge you to
> investigate this further.
> 
> > For the tests I used the examples from the Apache Thrift Tutorial.
> 
> Please include examples as text/plain attachments, if they are longer than a
> few lines.
> 
> 
> --
> With best regards,
> Andrey Repin
> Wednesday, March 25, 2020 14:08:25
> 
> Sorry for my terrible english...



More information about the Cygwin mailing list