Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support loopback adapter with external adapters
15-10-2014, 12:32 PM
Post: #11
RE: Support loopback adapter with external adapters
(15-10-2014 09:59 AM)simoncn Wrote:  
(15-10-2014 09:01 AM)simonc Wrote:  dmcs is the mono C# compiler. If you don't have mono installed, you can pass the --native flag to the test script:

python AllTests.py --native

This didn't work. I got the same problem with dmcs not being found.

Is any output generated around the failure that'd hint at which makefile target is being built at this point?

I can't easily reproduce this (every development machine we have already has mono installed). If you don't fancy debugging the convoluted makefilem it might be easiest for you to just install mono too.
Find all posts by this user
15-10-2014, 01:30 PM
Post: #12
RE: Support loopback adapter with external adapters
(15-10-2014 12:32 PM)simonc Wrote:  Is any output generated around the failure that'd hint at which makefile target is being built at this point?

I can't easily reproduce this (every development machine we have already has mono installed). If you don't fancy debugging the convoluted makefilem it might be easiest for you to just install mono too.

The following needs to be added to AllTests.py after line 44:

Code:
if gNativeTestsOnly == 1:
    buildArgs += ' native_only=yes'
Find all posts by this user
15-10-2014, 06:48 PM
Post: #13
RE: Support loopback adapter with external adapters
(15-10-2014 09:59 AM)simoncn Wrote:  When I have a bit of spare time, I'll do an experiment to see if my interpretation of how this works is correct.

I've tried this and the results are promising. All tests are now passing and MinimServer is working correctly.

I'll repeat these tests on Linux and Windows tomorrow. If all is well, I'll post a patch.
Find all posts by this user
16-10-2014, 09:54 AM
Post: #14
RE: Support loopback adapter with external adapters
(15-10-2014 06:48 PM)simoncn Wrote:  
(15-10-2014 09:59 AM)simoncn Wrote:  When I have a bit of spare time, I'll do an experiment to see if my interpretation of how this works is correct.

I've tried this and the results are promising. All tests are now passing and MinimServer is working correctly.

I'll repeat these tests on Linux and Windows tomorrow. If all is well, I'll post a patch.

Great, thanks for this!

Note that you won't need to test Windows. Mac and Linux share the same OS porting layer; Windows uses separate code so won't be affected by changes under ohNet/Os/Posix.
Find all posts by this user
16-10-2014, 10:20 AM
Post: #15
RE: Support loopback adapter with external adapters
(16-10-2014 09:54 AM)simonc Wrote:  Great, thanks for this!

Note that you won't need to test Windows. Mac and Linux share the same OS porting layer; Windows uses separate code so won't be affected by changes under ohNet/Os/Posix.

I am testing that calling setsockopt IP_MULTICAST_IF doesn't cause any problems when running on Windows or Linux. I have now confirmed this is OK for Windows.
Find all posts by this user
16-10-2014, 02:51 PM
Post: #16
RE: Support loopback adapter with external adapters
The patch is attached. I have confirmed that it works OK on Mac, Windows and Linux. Note that the new setsockopt IP_MULTICAST_IF call is made on all platforms, even though it is only required on Mac. This keeps the code simpler and more consistent across platforms.


Attached File(s)
.zip  multicast.zip (Size: 3.99 KB / Downloads: 1)
Find all posts by this user
17-10-2014, 09:53 AM
Post: #17
RE: Support loopback adapter with external adapters
(16-10-2014 02:51 PM)simoncn Wrote:  The patch is attached. I have confirmed that it works OK on Mac, Windows and Linux. Note that the new setsockopt IP_MULTICAST_IF call is made on all platforms, even though it is only required on Mac. This keeps the code simpler and more consistent across platforms.

There are 4 production clients of SocketUdp in ohNet. Two of these have been updated to call SocketUdp::SetMulticastIf(); the other two are unchanged. Is this deliberate? If it isn't, I'd be tempted to have SocketUdp::Bind() call Os::NetworkSocketSetMulticastIf() and remove SocketUdp::SetMulticastIf() and it's associated changes.

What do you think? (I'm not asking for you to post a new patch. Just checking I'm not misunderstanding.)
Find all posts by this user
17-10-2014, 10:21 AM
Post: #18
RE: Support loopback adapter with external adapters
(17-10-2014 09:53 AM)simonc Wrote:  There are 4 production clients of SocketUdp in ohNet. Two of these have been updated to call SocketUdp::SetMulticastIf(); the other two are unchanged. Is this deliberate? If it isn't, I'd be tempted to have SocketUdp::Bind() call Os::NetworkSocketSetMulticastIf() and remove SocketUdp::SetMulticastIf() and it's associated changes.

What do you think? (I'm not asking for you to post a new patch. Just checking I'm not misunderstanding.)

I think these calls should be separate as they are doing different things. I thought I had added the SetMulticastIf call in all cases where a socket is used to send multicast messages. Where are the other places that call Bind without calling SetMulticastIf? Are these sending multicast messages?
Find all posts by this user
17-10-2014, 01:14 PM (This post was last modified: 17-10-2014 01:45 PM by simonc.)
Post: #19
RE: Support loopback adapter with external adapters
(17-10-2014 10:21 AM)simoncn Wrote:  I think these calls should be separate as they are doing different things. I thought I had added the SetMulticastIf call in all cases where a socket is used to send multicast messages. Where are the other places that call Bind without calling SetMulticastIf? Are these sending multicast messages?

Ok, thanks, I understand now.

Later: The following turned out to be wrong...
One of the other users of SocketUdp - MdnsPlatform - is sending multicast messages so I'll update it too.
Find all posts by this user
17-10-2014, 01:58 PM
Post: #20
RE: Support loopback adapter with external adapters
(17-10-2014 01:14 PM)simonc Wrote:  Later: The following turned out to be wrong...
One of the other users of SocketUdp - MdnsPlatform - is sending multicast messages so I'll update it too.

Thanks for catching this!
Find all posts by this user


Forum Jump: