How to use the Emulation?

  • Thread starter Thread starter Simon Says
  • Start date Start date
S

Simon Says

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
 
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.
 
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
 
The post you mentioned is probably this one
http://groups.google.com/[email protected]&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
 
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
 
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.
 
I can, from unmanaged code, *send* multicast packets from the emulator, but
I can't *receive* them in the emulator.

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
 
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.
 
By the way, why are you setting the TTL to zero?

Paul T.

Paul G. Tobey said:
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.

Simon Says said:
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 said:
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


The post you mentioned is probably this one

http://groups.google.com/groups?q=a...framework&c2coff=1&selm=unf9KfpFEHA.1180@TK2M
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
 
I've tried setting the option in VB.Net as what you did in your native
code.

_multicastSCK.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.MulticastTimeToLive, 0)

Since you mention it, I also don't know know why I set the TTL in the
receiver to be 0. I think at that time of my thinking, when the receiver
received the multicast packet, if the TTL is set to 0, it will not re-route
out the packet to the router. Is this a right thinking. I'm actually more
concern for the sender portion where I do not want my multicast packet to
route over too many routers.

--Simon Teng


Paul G. Tobey said:
By the way, why are you setting the TTL to zero?

Paul T.

Paul G. Tobey said:
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.

Simon Says said:
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


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
 
I think that the value has to be 1 or greater and it's 1 by default in
Windows CE. If you have a WinSock reference, you might check into that.
After tracking it through a few help pages, here's the description:

Specifies the scope over which multicast transmissions will occur. Scope is
defined as the number of routed network segments to be covered. A scope of
zero would indicate that the multicast transmission would not be placed on
the wire but could be disseminated across sockets within the local host. A
scope value of one (the default) indicates that the transmission will be
placed on the wire, but will not cross any routers. Higher scope values
determine the number of routers that can be crossed. Note that this
corresponds to the time-to-live (TTL) parameter in IP multicasting. By
default, scope is 1.

Paul T.

Simon Says said:
I've tried setting the option in VB.Net as what you did in your native
code.

_multicastSCK.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.MulticastTimeToLive, 0)

Since you mention it, I also don't know know why I set the TTL in the
receiver to be 0. I think at that time of my thinking, when the receiver
received the multicast packet, if the TTL is set to 0, it will not
re-route
out the packet to the router. Is this a right thinking. I'm actually more
concern for the sender portion where I do not want my multicast packet to
route over too many routers.

--Simon Teng


Paul G. Tobey said:
By the way, why are you setting the TTL to zero?

Paul T.

Paul G. Tobey said:
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
 
Back
Top