Peter
Wed Nov 03 06:09:46 CST 2004
I have the same problem as Tom except I can't use the
IPAddress.Address method he recommended since that is an
obsolete method in .net Framwork 1.1.
Is there another way to use the MulticastInterface
SocketOption. It would be best if I could specifiy my
local IP address instead of an integer as the value for
MulticastInterface (The same way that it is done for
Addmembership).
/Peter
>-----Original Message-----
>v-phuang@online.microsoft.com ("Peter Huang") wrote in
>news:BBRJeVOtEHA.724@cpmsftngxa06.phx.gbl:
>
>> Hi Tom,
>>
>> Here is a KB article, you may take a look to see if
that is what you
>> want. HOW TO: Use SetSocketOption() with
MulticastInterface OptionName
>> in Visual Studio .NET (318911)
>>
http://support.microsoft.com/default.aspx?scid=KB;EN-
US;318911
>>
>> Best regards,
>>
>> Peter Huang
>> Microsoft Online Partner Support
>>
>> Get Secure! - www.microsoft.com/security
>> This posting is provided "AS IS" with no warranties,
and confers no
>> rights.
>>
>>
>
>
>That's not much of an excuse....it doesn't tell us what
the argument is, it
>just gets what someone types from the command prompt.
>
>I have however found that this works:
>
>setupSocket(IPAddress localIP, IPAddress mcIP, int port)
>{
> mcEP = new IPEndPoint(mcIP, port);
> MulticastOption mcastOption = new MulticastOption
(mcIP, localIP);
> sock.SetSocketOption(SocketOptionLevel.IP,
>SocketOptionName.AddMemebership, mcastOption);
> sock.SetSocketOption(SocketOptionLevel.IP,
>SocketOptionName.MulticastInterface, (int)
localIP.Address);
>}
>
>It's that (int)locapIP.Address that was key to figuring
this out. I don't
>know if its possible, but someone might update that KB
article to include
>something like this...so we know what it is that's
needed.
>Thanks,
>Tom
>
>.
>