libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] Starting 2 server on same port but different ip address


From: Shikha Sharma
Subject: [libmicrohttpd] Starting 2 server on same port but different ip address
Date: Wed, 25 Mar 2020 16:32:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

Hi,

I was trying to test some scenarios to see what is allowed and what is not allowed by MHD in respect to starting 2 servers on same port but different IP address.

The information for passing on the address to MHD_start_daemon api is:
     addr_hint.ai_family   = AF_UNSPEC;  /* IPv4 or IPv6 */
    addr_hint.ai_flags    = AI_ADDRCONFIG;
    addr_hint.ai_socktype = SOCK_STREAM;

For IPv6 addresses, Daemon is started by calling api  MHD_start_daemon(flags, port, MHD_OPTION_SOCK_ADDR, address..) where MHD_USE_IPv6 is set in flags.

For IPv4, is started same way but without MHD_USE_IPv6.

Below are some of the scenarios that I have tried:

Scenario 1:

  • Start S1 on : '0.0.0.0':6666
  • Start S2 on:  :'fe80::5054:ff:feec:73d1':6666

The MHD_start_daemon api is okay for S1 but fails for S2.

Scenario2:

  • Start S1 on : '0.0.0.0':6666
  • Start S2 on:  '::':6666

MHD_start_daemon call is successful on both.

Scenario3:

  • Start S1 on : '192.168.11.11':6666
  • Start S2 on:  '::':6666

MHD_start_daemon call is successful on both.

Scenario4:

  • Start S1 on : '192.168.11.11':6666
  • Start S2 on:  'fe80::5054:ff:feec:73d1':6666

MHD_start_daemon call fails on S2.

Both IP addressed are on same interface.Is this how they are supposed to work? Why is it that it fails in scenario 1 but is okay in scenario 3?

Trying to figure-out if its an issue at my end/expected behavior/issue in MHD?

Thanks & Regards,

Shikha


reply via email to

[Prev in Thread] Current Thread [Next in Thread]