|
|
|
start date: Thu, 2 Aug 2007 19:04:20 -0300,
posted on: microsoft.public.dotnet.framework.compactframework
back
| Thread Index |
|
1
aboni
|
|
2
Simon Hart
|
UdpClient.Send() through Router
Hi!
I'm developing a Client/Server using System.Net.Sockets.UdpClient.
My server app is running in a Windows XP Pro and Works Well.
My client app is running in a iPaq with Windows Mobile 5.0, and works well
when in the same network that my server.
The problem is that when I put a router between my server and my client, the
last can't send messages.
My first idea to solve the problem be modify the TTL of socket to 2, but I'm
don't do it.
I try with this two codes above below:
1 -
UdpClient udp = new UdpClient();
udp.Connect(new IPEndPoint(IPAddress.Parse("192.168.0.8"), 8000));
udp.Client.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.IpTimeToLive, 2);
udp.Send(Encoding.ASCII.GetBytes("Mobile"), 6);
2 -
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp);
IPAddress broadcast = IPAddress.Parse("192.168.0.8");
byte[] sendbuf = Encoding.ASCII.GetBytes("Mobile New");
IPEndPoint ep = new IPEndPoint(broadcast, 8000);
s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.IpTimeToLive,
100);
s.SendTo(sendbuf, ep);
The line "udp.Client.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.IpTimeToLive, 2);" does not have any effect.
Anybody know if is really the TTL the problem to communicate through Router.
Observetion: the Router model is ZWA-G120.
Thanks for any,
aboni
andrew@assergs.com
Date:Thu, 2 Aug 2007 19:04:20 -0300
Author:
|
RE: UdpClient.Send() through Router
The router needs to support port forwarding so packets will be forwarded onto
your server.
--
Simon Hart
http://simonrhart.blogspot.com
"aboni" wrote:
> Hi!
>
> I'm developing a Client/Server using System.Net.Sockets.UdpClient.
> My server app is running in a Windows XP Pro and Works Well.
> My client app is running in a iPaq with Windows Mobile 5.0, and works well
> when in the same network that my server.
> The problem is that when I put a router between my server and my client, the
> last can't send messages.
>
> My first idea to solve the problem be modify the TTL of socket to 2, but I'm
> don't do it.
>
> I try with this two codes above below:
>
> 1 -
> UdpClient udp = new UdpClient();
> udp.Connect(new IPEndPoint(IPAddress.Parse("192.168.0.8"), 8000));
> udp.Client.SetSocketOption(SocketOptionLevel.Socket,
> SocketOptionName.IpTimeToLive, 2);
> udp.Send(Encoding.ASCII.GetBytes("Mobile"), 6);
>
> 2 -
> Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
> ProtocolType.Udp);
> IPAddress broadcast = IPAddress.Parse("192.168.0.8");
> byte[] sendbuf = Encoding.ASCII.GetBytes("Mobile New");
> IPEndPoint ep = new IPEndPoint(broadcast, 8000);
> s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.IpTimeToLive,
> 100);
> s.SendTo(sendbuf, ep);
>
> The line "udp.Client.SetSocketOption(SocketOptionLevel.Socket,
> SocketOptionName.IpTimeToLive, 2);" does not have any effect.
>
> Anybody know if is really the TTL the problem to communicate through Router.
> Observetion: the Router model is ZWA-G120.
>
> Thanks for any,
> aboni
> andrew@assergs.com
>
>
>
Date:Wed, 8 Aug 2007 13:06:02 -0700
Author:
|
|
|