I know if a client system is accepting connections, there will be a lot of overhead. But I am just curios if it is even possible? i.e. Can a program connect to a server and also open another socket to accept clients?
2 Answers
It is common for a lot of more complex systems to be client and server. I don't even know what you mean with a lot of overhead. I would do it using threads to separate the client and server part but even that is not necessary using one of the poll/select network calls.
Can a program connect to a server and also open another socket to accept clients?
Yes, it (still ;-)) can!
select
call can poll a list of input and output sockets...