Quote Originally Posted by freak
This is done using QUdpSocket. I tried a similar thing with QTcpSocket and apparently they don't share the same member functions.
This approach won't work with TCP, because UDP is a connectionless protocol.

In UDP you send messages (datagrams) without any connection, so from UDP's point of view each message has no relation with others --- they can even be delivered in different order, than they were sent. Your application listens for datagrams, when it gets one, it processes it and waits for another message.

In TCP you create a connection between client and server (through this connection you can send a stream of bytes and TCP guarantees that each byte will be delivered in the same order as it was sent). Therefore your program must keep track of all connections.

QTcpServer notifies you when new client connects and gives you a QTcpSocket which you can use to communicate with that client. You have to use this socket until the client disconnects, so you need some object that will handle the connection with a single client.

You can have multiple clients connected to your server at the same time and each will have its own QTcpSocket.

Here are some examples that use TCP:
http://doc.trolltech.com/4.1/network...uneclient.html
http://doc.trolltech.com/4.1/network-fortuneserver.html
http://doc.trolltech.com/4.1/network...uneserver.html