So, I recently got into Qt networking/socket programming. I firstly had a server which just set up a new QTcpThread for every incoming connection and echoed input back.
But I kind of want to make a server where sockets(users) can log into different "chatrooms". My presumption is that you can make a "chatroom" with a QThread(then the thread just sends the data to all sockets on the thread).
So my questions are: 1: Can you connect multiple sockets to one thread?
2: If I can do that, how do I connect the client to the thread. I have tried to start up the thread with "MyThread *thread = new MyThread(socketDescriptor);", but then I can't connect to it with other than the socket with that exact socketDescriptor. - So, how do I give the thread either the socketdescriptor or socket?
So, how do I somehow get the id(socketdescriptor, socket) of the socket connectiong to the thread? That is what i can't figure out.