Network sync



  • Hello,
    I am creating two applications that use the network tools of Qt. It is a server that listens to a port and a client that connects to the server. All is fine except for one thing. When I write and read both ways there's a syncronization problem. The clients sends the info but it takes a few seconds until they are actually read from the server. The same problem appears vice versa.

    Is there a way to ensure synchronization?

    Thank you in advance



  • How u r communicating ? over QLocalSocket or some other way?

    It does not take that much of time, whats the data size that u r communicating



  • I use QTcpServer and QTcpSocket and their inhereted QIODevice functions. I use the write and read functions and it takes a few seconds which is rather unacceptable. If I start a netcat conversation between the two computers communication is instant every time. The size of the data is small. Usually less than ten bytes at a time.



  • I m not sure what u have done but here you can try this.

    Go to <Ur installed Qt folder> /examples/network/fortuneclient and examples/network/fortuneServer directory

    these example uses QTcpSocket for communication, try and run this application and see if that also takes the same time ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.