c++ - Non blocking threaded tcpi client in Qt -


please let me explain problem: have gui application, has connect remote server , keep connected time untill user decides quit connection, or server will. wish create client connection mechanism in separate thread. if client should able asynchronusly receive data , in event driven style inform main gui thread it. thread should able receive data gui thread sent server.

i come low level microcontroller place, handle task using interrupts , while(1) loop , flags. problem on pc, take processor time. have watched , read lot of tutorials sockets , threads in qt, still dont know best aproach , how properly.

for now, have test server on remote target able receive connections qt client trying write. have class client in qt, inherits qthread, read not best aproach anymore. wish create client instance in new thread (triggered gui thread) hang forever exec(). dont know how handle, using signals incoming data server , incoming commands main gui thread. in general, maybe know how implement on low level, read lot of high level functions qt delivers, wish use that.

i aprichiate in matter. tried searching, havent found solid, working date code examples. please explain me how create client instannce in new thread wont disconnect after sending/ receiving data, instead stay connected , stay responsive to server calls , gui thread calls in event driven style?

may use general qt socket mechanism instead separate thread better you. sockets similar mcu interrupts , simple use. application requests must enough.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -