nikpel7
nikpel7

Reputation: 676

Two processes sharing the same UDP port for sending

My application consists of a UDP server receiving high traffic.

I am thinking to increase the capacity throughput of the application and threading is not an option. So multiple instances of the same process is considered.

I was thinking whether it is possible to reuse the exact same UDP socket for sending out traffic between two different processes. I am interested only for sending since receiving is handled in another way.

Will setting option on socket to SO_REUSEADDR help here?

Upvotes: 1

Views: 4052

Answers (1)

Rahul R Dhobi
Rahul R Dhobi

Reputation: 5806

You can not create two servers in two different process because second request for binding on same port will be failed so you have to use SO_REUSEPORT option which allows socket to bind follow Let two UDP-servers listen on the same port? for your reference.

Upvotes: 4

Related Questions