ka4eli
ka4eli

Reputation: 5424

In what cases multiple port (socket) server is better regarding performance?

Under what conditions it's more suitable for server to listen on multiple ports?

Upvotes: 0

Views: 360

Answers (1)

u354356007
u354356007

Reputation: 3225

I don't think multiple sockets will result in any performance boost - unless the machine you use to run your application has several network interfaces in use. The real bottleneck is network latency, and sockets are just an abstraction, they can't do much here.

So, choose the amount of ports you want to use based on app requirements. I would better think of organizing socket IO in threads or processes:

When you send/receive/wait for data, do you block anything from working?

Upvotes: 1

Related Questions