Yes. I've found some examples at http://doc.qt.nokia.com/4.0/qt4-network.html#tcp-client. But It isn't what I'm looking for so I've read QTcpSocket class reference and tried to write something on my own:
char bufor[20];
tcpSocket->abort();
tcpSocket->connectToHost("localhost",57717);
bufor[0] = 'o';
tcpSocket->write(bufor,1);
tcpSocket->read(bufor,19);
char bufor[20];
tcpSocket = new QTcpSocket(this);
tcpSocket->abort();
tcpSocket->connectToHost("localhost",57717);
bufor[0] = 'o';
tcpSocket->write(bufor,1);
tcpSocket->read(bufor,19);
To copy to clipboard, switch view to plain text mode
but when I read I've got what I've just wrote ('o'). Tutorial in link above isn't clear for me. Can someone tell me what should I change in my code to make it work?
thanks in advance
best regards
Tomasz
Bookmarks