For each QTcpSocket returned by QTcpServer::nextPendingConnection() you can store information such as remoteAddress, remotePort and so on.
For each QTcpSocket returned by QTcpServer::nextPendingConnection() you can store information such as remoteAddress, remotePort and so on.
A camel can go 14 days without drink,
I can't!!!
I assume you are referring to peerAddress() and peerPort()?
Yes. you're right. I'm sorry for the mistake
A camel can go 14 days without drink,
I can't!!!
So if multiple clients are connected and want to send data to the server, how should the server handle reading the data for each separate client (i.e. readyRead())?
there isn't a unique solution but you could use a QSignalMapper to map each readReady signal with a slot with a parameter that allow to distinguish the client who sent data.
Read the documentation for use of QSignalMapper and try to use it.
A camel can go 14 days without drink,
I can't!!!
Bookmarks