Author Topic: connectin with name instead of ip  (Read 13009 times)

Offline Lukas

  • Newbie
  • *
  • Posts: 11
    • View Profile
connectin with name instead of ip
« on: August 26, 2008, 08:18:56 AM »
Hallo.
I have implemented the Netbios an it works. Clients can connect to my Serverapplication using the Netbios-name.
But is it also possible to connect to a server from my uTasker-Board with an name?
For example
fnTCP_connect(my_socket, SERVERNAME, port_number, 0, 0);

And for "SERVERNAME" I want to use the Netbiosname instead of the IP.
Thanks

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: connectin with name instead of ip
« Reply #1 on: August 26, 2008, 12:43:32 PM »
Hi

Unfortunately this is not supported in the project.

To add such a service is probably not that difficult though. It will have to maintain a table of NAME<-> IP matches for look up and can directly insert the IP if the name is already in the table. If the name is not in the table it will need to start a NETBios resolve (the reverse of the present sequence), which is in fact very similar to the operation of ARP, which maintains a table of IP<->MAC matches. Once the result of the NETBios resolve is known, the connection can be completed or else a failure can be reported.

Whereas ARP uses broadcasts to request information from the destination, NETBios uses a sub-net broadcast (usually UDP) which doesn't cross to other sub-nets in an Infranet. This needs LMHOSTS or a Windows Internet Name Service (WIMS) server if it is to work across multiple sub-nets - I know nothing about configuring these but mention it since my reference book says it is so...

Regards

Mark
« Last Edit: August 26, 2008, 09:49:18 PM by mark »