473,231 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

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 2115
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
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
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
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
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
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
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
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
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
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.