PDA

View Full Version : qt TCP socket



ketan
28th October 2009, 05:53
i want to read a data(text) directly from a incoming socket and writes to another outgoing socket using TCPServer.
please provide me a help on this.

JohannesMunk
28th October 2009, 12:08
One example, using the same sockect can be found just a few messages below yours:

http://doc.trolltech.com/solutions/4/qtservice/qtservice-example-server.html

The HTTPServer reads the GET Request, and answers to the socket with some HTML-code.

If you want to send data to an other socket you need to open a second socket. Do you have your other socket setup already? A place to start would maybe be the servers protected incomingConnection function.

HIH

Johannes

Rajeshsan
18th November 2009, 10:19
Hi ketan, Im new to Qt TCP sockets programming. So i need to write a program for sockets in Qt to transfer packets of data. I need to know in which way it is done. If possible plz post a sample code how to send data to another IP address PC in a Network. I want to learn it quickly so can you assist me. How to do it. Plz paster sample code how it can be done, just by entering remote IP address, An connection should be established.

Thanks in Advance.

ketan
20th November 2009, 12:17
hi..
if u want to send data packets across network use the ip address of reciver in connecttohost() mtd and have a defined port no for the two.
lets see this will solve ur prob or not..