Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8869041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:23:29+00:00 2026-06-14T17:23:29+00:00

I have two network interfaces and am trying to bind to the same UDP

  • 0

I have two network interfaces and am trying to bind to the same UDP port on both of them but I get an error when I try to bind to the second one, EADDRINUSE. When I bind to the sockets I pass a sockaddr* where I’ve setup the port and the unique IP address to use.

Do I have to use the socket option SO_REUSEADDR? Will this allow messages to be received on either socket or will they go to the socket that matches the IP address their bound to?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:23:30+00:00Added an answer on June 14, 2026 at 5:23 pm

    You can bind(2) one socket to INADDR_ANY for IPv4 or to in6addr_any for IPv6 (you don’t have to, but that’s the usual approach). That will make that single socket able to accept packets from all network interfaces on the box.

    Then SO_REUSEADDR socket option will allow you to bind other sockets to more specific addresses, i.e. to individual interfaces, and same port.

    Packets will be received on the socket that is bound to the address best matching the destination IP address of a given packet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have two servers in the same network. One of them is the server
I have two network cards in my server, and both of them are connected,
I have two network interfaces(Wireless and Ethernet) for connection but I just want to
I have two network interfaces on my Solaris machine and the output of ifconfig
I'm trying to capture packets from two devices on my network. I have tcpdump
I have a PC with two network interfaces: eth0 and eth1. eth0 - Has
I have two computers behind a router on the same network. On computer A,
I have a machine with VmWare installed which added two extra network interfaces. The
I have a server with two different network interfaces, each with a different IP
I have two Java applications in my network that talk to each other over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.