Qt: Automated monitoring of different sockets for available data
nextPendingConnection () returns a new socket with respect to a new client.
This new QSocket is passed to the connect () function which connects it to a SLOT 'xyz' with SIGNAL 'readyRead()'. Now in the SLOT 'xyz' how I am supposed to automate the monitoring of ALL connected sockets to see whether some data is available on them? One pathetic way would be to run all the sockets through a for loop and check each one of them for the data. Secondly, I read up on QSocketNotifier() here: http://doc.qt.nokia.com/4.7-snapshot...SocketNotifier But I am not sure if that is the correct thing, please guide. |
I'm not well acquainted with Qt, but reading between the lines, it sounds like you are setting up various connections with signal handlers to handle the incoming data. This is a method to avoid the problem of 'monitoring of ALL connected sockets to see whether some data is available on them'. It sounds like you are inventing a problem which has already been avoided.
--- rod. |
Thanks for replying, but somewhere I have to call the read function w.r.t the socket on which data is available, que is the read func. should be called for which socket if there are 10 of them?
|
|
All times are GMT -5. The time now is 02:23 PM. |