-1

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
  • 2
    With the correct setup yes why not. That's basically how a proxy "server" works. Commented Feb 23, 2017 at 9:57
  • 1
    And that's the reason why the select call can poll a list of input and output sockets... Commented Feb 23, 2017 at 9:59

2 Answers 2

0

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.

-1

Can a program connect to a server and also open another socket to accept clients?

Yes, it (still ;-)) can!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.