473,606 Members | 2,381 Online
Bytes | Software Development & Data Engineering Community
+ 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.Direc toryInfo object to open the share.

I want to connect the the share \\ControlPC\tem p 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\tem p, but not \\192.168.0.5\t emp

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 2127
On Wed, 03 Sep 2008 19:39:33 -0700, Steve McKewen <st******@albur y.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\tem p, but not
\\192.168.0.5\t emp

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*********@nn owslpianmk.comw rote:
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\sha re .

//Resolve the IP Address to a host name
System.Net.IPHo stEntry aIPHE = System.Net.Dns. GetHostEntry("1 92.168.0.12");
//Show the result
this.lblHostNam e.Text = aIPHE.HostName;
System.String aPath = @"\\" + 192.168.0.12+ @"\" + "temp";
//Get the directory
try
{
System.IO.Direc toryInfo aDI = new System.IO.Direc toryInfo(aPath) ;
System.IO.FileI nfo[] aFIArray = aDI.GetFiles();
foreach (System.IO.File Info aFI in aFIArray)
{
listBox1.Items. Add(aFI.Name);
}
}
catch (Exception ex)
{
listBox1.Items. Add(ex.Message) ;
}

When I run this code fragment,
the IPHostEntry.Hos tName 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*********@nn owslpianmk.comw rote in message
news:op******** *******@petes-computer.local. ..
On Wed, 03 Sep 2008 20:09:13 -0700, Peter Duniho
<Np*********@nn owslpianmk.comw rote:
>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.IPHo stEntry aIPHE = System.Net.Dns. GetHostEntry("o ar-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.IPHo stEntry aIPHE = System.Net.Dns. GetHostEntry("o ar-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******@albur y.nsw.au>
wrote:
Further testing

When I try to resolve the name to an IP address

System.Net.IPHo stEntry aIPHE = System.Net.Dns. GetHostEntry("o ar-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
11152
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, this code returns the traceback that follows: import telnetlib host = 'nnn.nnn.nnn.nnn'
8
12092
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). It has worked relatively well for some time, but recently I'm often encountering errors when trying to fetch the data. I am pretty sure that this is because of a poor wireless connection since I'm also having some problems e.g. copying files...
0
1517
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 single physical network seems easy enough, just send messages to IP addresses. I have a central computer which uses web pages to register who is on the network and who is not which I can make up easily. The problem arrises when trying to make it...
45
3039
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 course they also want to access the db. I am a bit afraid of possible corruption due to the wireless connections. ==> Do I have to be afraid indeed? If so, what is the best way to deal with this? Should I trace the wireless connections...
1
2017
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. Because of our business practices, we are fairly confident that only one group will be updating a given record at any one time but the users will be updating their own local database servers and those updates must appear on all three servers....
16
4394
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 through a wireless connection, or limit their use to read-only. I have absolutely no idea if this is possible, and if so, how. Is there any way from within Access to get the list of routers they are connecting through? Ideally, I'd like to keep...
0
1828
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 properties dialog then backed up the database and restored it to servers B and C. Once restored, I tried to Configure Peer-to-Peer Topology from the right click menu on the publication in SQL Management Studio (2005). When I click OK, the wizard...
21
3189
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 (i.e. the get_hash function) is borrowed from various snippets I found on the net. Thee free function could probably need some love. I have been thinking about having a second linked list of all entries so that the cost of freeing is in proportion to...
0
7955
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8431
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8096
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8306
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
3937
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2448
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 we have to send another system
1
1557
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1300
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.