473,480 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Wireless peer to peer name resolution

I am working on Windows Mobile 6 with VS2005.

I want my mobile devices to connect to a shared folder on a PC in an
isolated network environment. I don't have a server or router in the
network, so don't have a DNS server.
I can ping the PC using its IP address, but not its hostname.
I have written a ping routine using a dotnet socket to send an
IcmpPacket.
I can connect to the shared folder by the hostname but not the IP address.
I am using a System.IO.DirectoryInfo object to open the share.

I want to connect the the share \\ControlPC\temp on the PC named ControlPC
at 192.168.0.5
I can ping 192.168.0.5, but I can't find the hostname for that IPAddress.
I can connect to the share at \\ControlPC\temp, but not \\192.168.0.5\temp

I tried to resolve the IPAddress to a name using System.Net.Dns.GetHostEntry
but just get an exception "No such host is known".
Is there a way around this without adding a DNS server to my network?

Thanks
Steve in ABX
Sep 4 '08 #1
5 2119
On Wed, 03 Sep 2008 19:39:33 -0700, Steve McKewen <st******@albury.nsw.au>
wrote:
[...]
I can ping 192.168.0.5, but I can't find the hostname for that IPAddress.
I can connect to the share at \\ControlPC\temp, but not
\\192.168.0.5\temp

I tried to resolve the IPAddress to a name using
System.Net.Dns.GetHostEntry
but just get an exception "No such host is known".
Is there a way around this without adding a DNS server to my network?
This is more of a network config question than a programming question.
You would probably get better, more useful answers if you posted your
question to a more appropriate forum.

That said: I don't understand why you can't connect by IP address (seems
to work okay for me). It might help if you could be more specific than
simply saying you can't do it.

Also, Windows does support a LAN without a DNS server. The LAN will
"elect" a name server, using (if I recall correctly) NetBIOS as the
supporting protocol. If you're not getting normal name services over your
network, maybe you've got NetBIOS disabled (either as its own protocol, or
enabled under the TCP/IP settings).

I realize that answer is "hand-wavy". Like I said, you'd probably be
better off posting to a different forum. :)

Pete
Sep 4 '08 #2
On Wed, 03 Sep 2008 20:09:13 -0700, Peter Duniho
<Np*********@nnowslpianmk.comwrote:
Also, Windows does support a LAN without a DNS server. The LAN will
"elect" a name server, using (if I recall correctly) NetBIOS as the
supporting protocol. If you're not getting normal name services over
your network, maybe you've got NetBIOS disabled (either as its own
protocol, or enabled under the TCP/IP settings).
Sorry...I mixed things up a little. You can use NetBEUI as the protocol
that naturally implements NetBIOS, or run NetBIOS over the TCP/IP
protocol. I don't think there's an actual NetBIOS protocol you can have
running on your network adapter in Windows.

Of course, I could still be mixed up. But that's the best clarification I
know to make. :)
Sep 4 '08 #3
Thanks Peter.

My problem (I think) is with the reduced network functionality of the
Windows Mobile 6 dotnet libraries.

If I try to do this with PCs it works without any problems.

I only have this problem on a windows mobile professional device.
If I have a DNS server on the network it works fine, but I don't need a DNS
server for anything else, so I don't want to add one, just to resolve names
and addresses.

My network consists of a PC, and a collection of hand held windows mobile 6
pro devices.
The mobile devices connect to the PC and download configuration files that
include IP addresses of IO modules that they connect to. All subsequent
connections are done by ip address, but I don't seem to be able to connect
to the PC by \\ipaddress\share .

//Resolve the IP Address to a host name
System.Net.IPHostEntry aIPHE = System.Net.Dns.GetHostEntry("192.168.0.12");
//Show the result
this.lblHostName.Text = aIPHE.HostName;
System.String aPath = @"\\" + 192.168.0.12+ @"\" + "temp";
//Get the directory
try
{
System.IO.DirectoryInfo aDI = new System.IO.DirectoryInfo(aPath);
System.IO.FileInfo[] aFIArray = aDI.GetFiles();
foreach (System.IO.FileInfo aFI in aFIArray)
{
listBox1.Items.Add(aFI.Name);
}
}
catch (Exception ex)
{
listBox1.Items.Add(ex.Message);
}

When I run this code fragment,
the IPHostEntry.HostName is "192.168.0.12"
I get an IO Exception when I create aDI.

When I run this code fragment but replace the "192.168.0.12" string with
"oar-pc" (the name of the PC) it works fine.

What I don't understand is how the DirectoryInfo object is using the
hostname to connect, when I can't resolve the ipaddress to a hostname.

Steve
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Wed, 03 Sep 2008 20:09:13 -0700, Peter Duniho
<Np*********@nnowslpianmk.comwrote:
>Also, Windows does support a LAN without a DNS server. The LAN will
"elect" a name server, using (if I recall correctly) NetBIOS as the
supporting protocol. If you're not getting normal name services over
your network, maybe you've got NetBIOS disabled (either as its own
protocol, or enabled under the TCP/IP settings).

Sorry...I mixed things up a little. You can use NetBEUI as the protocol
that naturally implements NetBIOS, or run NetBIOS over the TCP/IP
protocol. I don't think there's an actual NetBIOS protocol you can have
running on your network adapter in Windows.

Of course, I could still be mixed up. But that's the best clarification I
know to make. :)

Sep 4 '08 #4
Further testing

When I try to resolve the name to an IP address

System.Net.IPHostEntry aIPHE = System.Net.Dns.GetHostEntry("oar-pc");

I get "The system detected an invalid pointer address in attempting to use a
pointer argument in a call". exception.
If I change the hostname to an name that is not available on the network
like this:
System.Net.IPHostEntry aIPHE = System.Net.Dns.GetHostEntry("oar-pc1");

then I get "No such host is known" exception as expected.
Sep 4 '08 #5
On Thu, 04 Sep 2008 00:17:49 -0700, Steve McKewen <st******@albury.nsw.au>
wrote:
Further testing

When I try to resolve the name to an IP address

System.Net.IPHostEntry aIPHE = System.Net.Dns.GetHostEntry("oar-pc");

I get "The system detected an invalid pointer address in attempting to
use a
pointer argument in a call". exception.
Sounds like a bug to me. You might consider reporting the behavior on the
http://connect.microsoft.com/ web site.

Of course, your question is really more specific to Windows Mobile and
there's lots about that I have no experience with. But all of the
behaviors your describing sound like there's some sort of disconnect
between .NET and what's supported in the underlying Windows API. Both
have reduced functionality on mobile/compact platforms, of course. But it
sounds as though .NET may be making some assumptions about what the
underyling unmanaged API supports that turns out to be incorrect.

I'm especially boggled that the IP-based UNC path doesn't work. I'd have
thought that'd require the least amount of effort on the part of the OS,
so I almost wonder if .NET is getting in your way there. If p/invoke is
supported on Windows Mobile, you might consider at least doing a test with
that to see if you can work around limitations in .NET, if not use that as
an actual solution.

For the best advice though, you should really post your question and
observations to a forum specific to Windows Mobile. You'll get a much
wider group of people with relevant experience there (wherever "there" is,
of course...I don't actually know off the top of my head).

Pete
Sep 4 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
11124
by: Donnal Walter | last post by:
On Windows XP I am able to connect to a remote telnet server from the command prompt using: telnet nnn.nnn.nnn.nnn 23 where nnn.nnn.nnn.nnn is the IP address of the host. But using telnetlib,...
8
12069
by: Peter Larsson | last post by:
Hi there, I've recently developed a VBA-program in Excel that fetches and presents data from a distant Access database over a wireless peer-to-peer network (both computers running Win XP Pro)....
0
1510
by: David Pendrey | last post by:
Greetings everyone, I am currently making a program which will need a peer to peer service but I have no idea how to make it work with the modern networks. Getting a peer to peer network on a...
45
3001
by: Arno R | last post by:
Hi all, I am about to distribute an A97-runtime app. which will be used on a LAN by approx. 30 users. The network is pretty good, but there are a few managers who have wireless laptops... Of...
1
2003
by: EoRaptor013 | last post by:
We have a situation almost exactly like that in the MS documentation vis a vis peer-to-peer replication. We have three servers and three user groups, one each in Chicago, New York, and Bermuda....
16
4378
by: google | last post by:
Hello, I am working on an Acc2003 app for my company. In the interest of reducing chances of corruption due to unstable network connectivity, I would like to either prevent users from running it...
0
1821
by: EoRaptor013 | last post by:
I have been trying for several days to create a peer-to-peer replication among three servers. I first created the publication on Server A, enabled it for peer-to-peer to peer on the publication...
21
3163
by: Johan Tibell | last post by:
I would be grateful if someone had a minute or two to review my hash table implementation. It's not yet commented but hopefully it's short and idiomatic enough to be readable. Some of the code...
0
7057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6756
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4495
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3008
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.