I'm working on a project that requires listening and processing messages from multiple external sources.
My application is written in C and running on a Linux Read Hat 9 machine.
I have successfully connected to one external source, but have a questions on how to connect and listen to more than one source without blocking each other.
Generally, how I connect to a source is like this:
My question is, if I have have 2 hdles and use FD_SET() on rd1, will I be able to detect incoming data from both sources?
int hdle1 = setup(.....); //setup is a function in an API I'm using
select(hdle+1, &rd1, NULL, NULL, NULL); //waiting
if so, will it create blocking on one of the sources if no data has been detected from the other source? (waiting on one source while the other one has data)
Thanks in advance for your help! Any input is appreciated!
int hdle1 = setup(.....); //set up first source
int hdle2 = setup(.....); //set up second source
select(hdle+2, &rd1, NULL, NULL, NULL); //waiting