Re: Ad-hoc network using TCP

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Again, tks!

The server is a pc, it's the "clients" that are the handheld devices.
I have the sensor network and the udp communications already working
correctly, so i'm just playing with TCP now on w32 apps (since i now
made sure it works by the "air"). It'll be basically sending text files

around.
But could u explain me the difference between using a TCPListener and
creating a socket binded to an EndPoint with those TCP/IP settings?
They both work, but i can't choose one over the other cause i don't
really know the differences. I'd prefer one more flexible for when i'll
have to deal with multiple clients and then broadcast info.
tks.

Paul G. Tobey [eMVP] escreveu:
2. You're reading more into "TCP" than is really there. Set it to
Unspecified or IP.

3. I wouldn't set it to 300 for a PC-based server, let alone a small server
on the Pocket PC...

4. I understand that the *goal* is ad hoc, but trying to do everything at
once is almost always a bad idea. That's why you build and download and try
your application several times during its development, rather than trying to
code the entire application before ever trying it! Remember that localhost
doesn't necessarily *do* any real network I/O, also...

Paul T.


"zainab" <pedralm@xxxxxxxxx> wrote in message
news:1152562117.376958.240660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello!
thanks for the replies!
yes, it was a subnet mask problem. it was indeed 255.255.0.0 and with a
set gateway. i had no idea as the pda isn't mine and i was using the
used settings for the udp, that worked (silly me for not thinking of
this eariler), but it works correctly now.

About the previous reply:

1. I don't see any reason to bind the socket to a particular IP
address.
Why don't you pass IPAddress.Any as the first parameter to your
IPEndPoint
constructor?
Yes, i'll do this after (it was set to this as i was minimizing the
chances for it not to go anyway wrong, so everything was as specific as
possible).

2. I'd set the ProtocolType to either Unspecified or IP, not TCP.
I'll try, but i dont know the exact difference. I thought since i
wanted TCP, TCP it is.

3. Listen( 200 ) is a *very* large backlog number for a little mobile
device. 5 would be more reasonable, in my book.
There are plenty mobile devices, not just one, but yes, 200 is too
large!

Client:

4. What's the subnet mask of these addresses? They're
statically-assigned,
not DHCP, right?
Yes, static, and obtained in run time (via Dns.GetHostName.AdressList)

Can you make the code work on a normal, either wired or wireless
infrastructure mode, network? Ad hoc just complicates things and, for
me,
I'd try to get it working on the simplest-to-use network and then move
to ad
hoc and try to get it working.
It really has to be ad-hoc... the mobile devices connect to a local
gateway that has a sensor network linked to it and then info is
broadcasted via tcp/udp (depending on the data being sent) to the
mobile devices.
While testing, i'll just use localhost and two win32 apps. If not just
for speed, as the connection establishing on pda<->pc is taking 8-10
seconds...

Thanks again!


Paul G. Tobey [eMVP] escreveu:
Both devices have to be on the same subnet. So, mask each IP with the
subnet mask of the device and those values *must* match. For example:

device #1 IP = 192.168.0.20, subnet mask = 255.255.255.0

result = 192.168.0.0 is the subnet.

device #2 IP = 192.168.1.20, subnet mask = 255.255.255.0

result = 192.168.1.0 is the subnet

Since these two devices have *different* subnets, they can only
communicate
if there is a router between them (and they must both have the IP address
of
that router, as it faces them), set properly in their configurations.
They
cannot communicate directly with each other. Because of the zeroes in
one
of your subnets, communication, at least partial might be mistakenly
thought
to be occurring.

You could also have changed the subnet masks on *both* devices to
255.255.0.0 and that would have worked, too (the masked subnet for both
devices, in that case, would have still been 192.168.0.0, allowing them
to
talk to each other).

Paul T.

"zainab" <pedralm@xxxxxxxxx> wrote in message
news:1152557414.659758.150410@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
well, nevermind, seemed to be an IP problem....
changed the 192.168.1.20 to 192.168.0.2 and it worked...



.



Relevant Pages

  • Re: VPN connection cant route to lan
    ... any other network devices on the network hosting the the SBS/RAS server via ... Ethernet adapter Server Local Area Connection: ... Corporate LAN subnet. ...
    (microsoft.public.windows.server.sbs)
  • Re: New install into existing subnet
    ... AND it sounds like you're new to SBS. ... How to install Small Business Server 2003 in an existing Active Directory ... there's no reason for you to implement a new subnet. ... If the existing network was SBS you might want to look at ...
    (microsoft.public.windows.server.sbs)
  • Re: Make a DHCP server using Fedora - Help
    ... The dhcpd configuration is highly network-dependent. ... What is your network topology? ... please write a subnet declaration ... Do you want dynamic updating of your local dns server? ...
    (Fedora)
  • Re: WINS issue
    ... browsing across subnets (My Network Places) requires a WINS ... > why the server is not showing up in My Network Places. ... > computer in that subnet. ... > between the Local Master Browser and the Domain Master Browser. ...
    (microsoft.public.windows.server.networking)
  • Re: Problems after promoting member server to a DC
    ... I have a network that is spread across two locations. ... policies and the connection speed. ... a test member server and promoted it to be a domain controller. ... That server is no longer able to communicate with the ...
    (microsoft.public.windows.server.sbs)