All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
Multicast support with SFU 3.5
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login |
|
|
Multicast support with SFU 3.5 - Jun. 28, '06, 6:25:25 PM
|
|
|
kindel
Posts: 22
Joined: Jun. 6, '06,
Status: offline
|
Hi all!
I'm hoping one of you can point me in the right direction here, since I have hit a wall getting our multicast application ported over and am not sure where to find more docs / help.
What I'm trying to do is really basic: I want to set the sock opt on a socket to do make an ADD_MEMBERSHIP call.
Here is the code basics:
setsockopt(s, level, osOptType, (char *)optVal, optLen);
straight from the debugger:
s is the socket, level is IPPROTO_IP (0), soOptType is IP_ADD_MEMBERSHIP (5), optval is ip_mreq (imr={imr_multiaddr = {s_addr = 0x10a64e1}, imr_interface = {s_addr = 0xdea7a8c0}}), optLen is 8.
The result is errno 22.. EINVAL, invalid argument.
I'm on x86, so the multicast and ip addresses look right (225.100.10.1 and 192.168.167.201 respectively).
I do successfully run other setsockopts at the Socket level on this same socket with no problem.
My areas of suspicion:
- is it having trouble finding the NIC to bind to? Would it throw this error? Is there any way to test this? Do I need to do anything special to get Interix to know about my windows NICs? Note.. I did try this both with both a DHCP and non-DHCP using NIC with no change in results.
- does this not take a standard ip_mreq type as the argument? The header files are unclear and I couldn't find this in the man pages.
- does Interix support multicast? (I've seen no mention on the bulletin boards)
Thanks!
-Bob
|
|
|
RE: Multicast support with SFU 3.5 - Jun. 28, '06, 9:38:59 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
There is multicast support. I remember using it in during the Softway days.
There is no IP_ADD_MEMBERSHIP so EINVAL is correct.
It was a long time ago, so I'll have to dig up notes on it, but I think
it was using an IP mask to set the destinations (or something like that).
I'll see if I can find my notes from then. A quick read of the man pages
shows it's for datagrams with SO_BROADCAST.
DHCP or not shouldn't have anything to do with it.
The NIC's are controlled through WinSock which is used by the Win32 and Interix
subsystems; Interix has some additionals for Unix behavior (i.e. SIGIO).
|
|
|
RE: Multicast support with SFU 3.5 - Jun. 29, '06, 10:02:54 AM
|
|
|
kindel
Posts: 22
Joined: Jun. 6, '06,
Status: offline
|
For what it's worth, IP_ADD_MEMBERSHIP is a flag listed in /usr/include/netinet/in.h ...
That said, I agree that it doesn't seem to be actually supported.
Thanks for anything you can find on this.
-Bob
|
|
|
RE: Multicast support with SFU 3.5 - Jun. 29, '06, 1:22:54 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
That file ships as part of the Interix SDK base (reference for fair readers).
The file was created, again, back in the Softway days (pre-MS).
The underlying WinSock has changed over the years for what it supports
and doesn't support. We ran into that with some TOS stuff over the years.
It may be that a macro mapping was changed or masked since then.
So, if nothing else, it's a place holder for the future.
|
|
|
RE: Multicast support with SFU 3.5 - Jun. 29, '06, 2:08:51 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
Digging way back in my notes I did add specific code to the subsystem to allow
for multicasting in 1998 (again the Softway days). How things were implemented
in WinSock didn't match to the documention exactly. I noted then that I could
getsockopt() IP_MULTICAST_LOOP but could do setsockopt(). I don't know if that
was a WinSock messed up thing, or it was because I was on an NT4.0/Pro instead
of a Server machine (you know how MS likes to do things like that).
Now my notes don't actually mention anything about ADD or DROP. But ip_mreq will be
the size of two in_addr's.
The one thing I do have written down from then is that I didn't yet make an internal
i/f table for the NIC's, so that may or may not affect IP_MULTICAST_IF. I haven't
had subsystem code access for many years at this point and any plans I had then
went up in smoke by the end of 1999.
You could try writing a small Win32 program to test setsockopt() for multicasting.
Yeah, I know none of us really want to :-)
But it may confirm/deny that WinSock is capable of it versus there being something
changed in the Interix/SUA subsystem in this area (which is possible8 years later).
|
|
|
RE: Multicast support with SFU 3.5 - Jul. 7, '06, 6:04:15 PM
|
|
|
kindel
Posts: 22
Joined: Jun. 6, '06,
Status: offline
|
We definitely use multicast successfully with WinSock2... we support normal Win32 dlls as well with the same software (though through a different code path). Are you implying that there is a way to get at that functionality directly through SFU?
-Bob
|
|
|
RE: Multicast support with SFU 3.5 - Jul. 8, '06, 1:06:16 AM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
Win32 and Interix both use WinSock for the socket communication.
Interix layers in additional Unix functionality that often expected
from Unix code (the SIGIO signal for example).
Most socket options with setsockopt(), if I recall correctly, are mostly
just passed through to WinSock since the work is to be done by WinSock.
As I recall the BSD and WinSock setsockopt() macros were aligned in
name if not in value. IPPROTO_IP is in <netinet/in.h>.
ah, okay and I see IP_ADD_MEMBERSHIP and friends are there too and
you'll notice mapped to WinSock values (the old BSD ones are listed).
And "struct ip_mreq" is declared there as well.
Looks like it should work. Give it a whirl if you already have the code.
Oh, sorry, that was your first message where you tried it.
hmmm, let me ponder a bit...
< Message edited by Rodney -- Jul. 8, '06, 1:07:38 AM >
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|