I've never done it, but, generally, what's supported by native code is
duplicated in the .NET CF. Did you verify that you are trying to set the
option in the same way that I showed in my native code example (you're
using the same option type IPPROTO_IP)?
Paul T.
Thanks Paul for confirming the receiving of multicast packet via the
emulator.
I need to set the TTL to control my multicast packet don't travel too
far.
Nonetheless, do I have to use native code to set the TTL? Any easier way
with VB.Net?
--Simon Teng
"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
wrote in message I can, from unmanaged code, *send* multicast packets from the emulator,
but
I can't *receive* them in the emulator.
Paul T.
"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
wrote in message It doesn't appear to me that multicasting will work across that
interface,
even if you set the TTL to 2.
The time-to-live can be set via the basic WinSock calls. Here's
the
sample code from the help:
// Set the Time-to-Live of the multicast.
if (setsockopt (Sock,
IPPROTO_IP,
IP_MULTICAST_TTL,
(char FAR *)&iOptVal,
sizeof (int)) == SOCKET_ERROR)
{
wsprintf (szError, TEXT("setsockopt failed! Error: %d"),
WSAGetLastError ());
MessageBox (NULL, szError, TEXT("Error"), MB_OK);
closesocket (Sock);
return FALSE;
}
You might verify that you are using the corresponding parameters in
your
managed calls.
Paul T.
Yes, that's the link. Below is the portion from your reply.
MulticastOption opt = new MulticastOption("192.168.0.1");
opt.Group = IPAddress.Parse("239.255.255.254");
socket.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.AddMembership,
opt);
The MulticastOption construction actually takes in the multicast
group
parameter, so, what is the reason you pass in "192.168.0.1"? Also,
how
can I
set the MulticastTimeToLive option? I keep getting runtime error, and
a
little research on the web, I found out that Win CE.Net do not
support
this
parameter. Do you know what is the default value for this if I don't
have
a
way to set it?
I was also "hoping" for a real device on hand so that I could test it
out.
Currently I'm trying to push our company's product platform all to
.net
based, and because of the budget "thing", I would have to live
with
an
emulator for the time being.
--Simon Teng
message
The post you mentioned is probably this one
http://groups.google.com/groups?q=addmembership&hl=en&lr=&group=microsoft.pu
blic.dotnet.framework.compactframework&c2coff=1&selm=unf9KfpFEHA.1180%40TK2M
SFTNGP09.phx.gbl&rnum=1
Now the problem with UDP broadcast is that frankly, I do not
remember
if
VPC
virtual switch driver can handle that. Is there any way you could
try
this
with a real device with a network card? Keep in mind that activesync
connection does not let through UDP traffic
--
Alex Feinman
---
Visit
http://www.opennetcf.org
Thanks Alex for your advise, and sorry for the crosspost.
Ok ... now I can get the connection working with 2 different IP
addresses
with a quick TCP application; but I can't get my multicasting
to
work.
Now,
my desktop IP is 172.10.10.1, and my emulator IP is
192.25.23.2.
I'm
pretty
sure that my code for the joining and receiving the multicast
group
works
because I have ported that portion to a full .net framework
application
and
it works. Therefore, I'm suspecting more of the emulator IP
settings
not
right or something like that. Can you please advice on this???
Also, I've seen one of your reply to a posting regarding
setting
multicast
socket but I just can't find the posting now. Below is the portion
of
my
code in .net framework, how can this running in .net cf running on
Window
CE.Net 4.2 ???
_multicastSCK = New Socket(AddressFamily.InterNetwork,
SocketType.Dgram,
ProtocolType.Udp)
_multicastSCK.SetSocketOption(SocketOptionLevel.Udp,
SocketOptionName.NoDelay, 1)
_multicastSCK.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReuseAddress, 1)
_multicastSCK.Bind(localPoint)
_multicastSCK.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.MulticastTimeToLive, 0)
_multicastSCK.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.AddMembership, _
New MulticastOption(IPAddress.Parse("255.10.10.10")))
--Simon Teng
message
0) Please, do not crosspost.
1) The emulator IP cannot be set to the same value as the
machine,
hosting
it - they are two different devices and you will cause a conflict
2) PC needs to be either physically connected to a network or
have
a
MS
Loopback adapter installed, otherwise Visual Studio will have
problems
with
it
3) Go ahead and hard-reset your emulator to restore the
default
settings.
--
Alex Feinman
---
Visit
http://www.opennetcf.org
Dear all,
I'm trying to use the emulator to test on some multicasting
application.
But
I just can't seems to get the TCP/IP working on the
emulator. I
set
the
IP
address on the WinCE.Net emulator to be the same as my
development
PC's
IP.
I try to run it but VS2003 just can't connect to the
emulator
not
more.
Can anyone please advice ...
--Simon Teng