Recent

Author Topic: Quick lookup of host:address parameter  (Read 1055 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 8533
Quick lookup of host:address parameter
« on: December 22, 2022, 09:50:13 am »
For a program which is really only interested in the local network, what's the "least-hassle" way of converting host:port to a directly usable address, possibly including a name lookup?

fcl-net no longer appears in the documentation at https://www.freepascal.org/docs-html/current/fcl/index.html so I presume it's deprecated...

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Quick lookup of host:address parameter
« Reply #1 on: December 22, 2022, 09:59:17 am »
On fcl-net wiki is nothing mentioned about that it is deprecated.
(And in my newest stable FPC installation, it is on my hard-drive automagical saved to use)

Lazarus 2.2.4 (rev lazarus_2_2_4) FPC 3.2.2 x86_64-win64-win32/win64
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Quick lookup of host:address parameter
« Reply #2 on: December 22, 2022, 10:07:02 am »
And when I do look at Networking page, it is listed.
Other things you might be interested in you find at the Networking libraries page.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Thaddy

  • Hero Member
  • *****
  • Posts: 18729
  • To Europe: simply sell USA bonds: dollar collapses
Re: Quick lookup of host:address parameter
« Reply #3 on: December 22, 2022, 10:09:06 am »
fcl-net is not deprecated. Plz file bug against documentation. (Note the wiki is not a good place to check that, the official documentation is! )
« Last Edit: December 22, 2022, 10:11:30 am by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

MarkMLl

  • Hero Member
  • *****
  • Posts: 8533
Re: Quick lookup of host:address parameter
« Reply #4 on: December 22, 2022, 10:21:40 am »
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40060 (seems a bit concise for me. I miss the Mantis forms).

I agree with Thaddy's point about the Wiki not being definitive. Anybody who feels like arguing otherwise has a very big job on their hands culling dead pages and making sure that everything left is accurate.

The first important question is, how the Hell did things get to this state without anybody noticing and fixing it promptly?

The second is how long will it take to fix this, since that's the primary public-facing resource which tells people what's in FPC and why they should take it seriously?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 8533
Re: Quick lookup of host:address parameter
« Reply #5 on: December 22, 2022, 10:27:43 am »
On fcl-net wiki is nothing mentioned about that it is deprecated.

OK, I'll bite. "I can't find anywhere in the Bible that says this, but Thomas Aquinas concludes that it must be correct therefore it is true".

Have you the faintest idea how many people have been burnt at the stake for saying that sort of thing?

:-|

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Quick lookup of host:address parameter
« Reply #6 on: December 22, 2022, 10:46:51 am »
I am sorry, I do apology, I assume that our both installations are total wrong since it is not mentioned on the official site please remove it instantly from your system and never think about to use it in future anymore until the official site tells you that it is included to be used again even if files are present to be used, must be a bug.

I really just wanted to help but while reading this, I agree, I will not refer to bad wiki pages anymore, thank you for that lesson.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

ccrause

  • Hero Member
  • *****
  • Posts: 1093

ccrause

  • Hero Member
  • *****
  • Posts: 1093
Re: Quick lookup of host:address parameter
« Reply #8 on: December 22, 2022, 11:10:50 am »
For a program which is really only interested in the local network, what's the "least-hassle" way of converting host:port to a directly usable address, possibly including a name lookup?

Are you looking for something like the ResolveHostByName function in the netdb unit?

MarkMLl

  • Hero Member
  • *****
  • Posts: 8533
Re: Quick lookup of host:address parameter
« Reply #9 on: December 22, 2022, 11:27:25 am »
Are you looking for something like the ResolveHostByName function in the netdb unit?

Yes, but was suffering from lack of any form of documentation. I've gone back to something I wrote years ago and pulled a function that wraps a THostResolver, but my notes suggest that I had to deal with a lot of erratic behaviour including endianness issues and also having to decide whether a parameter was a hostname or a dotted quad... something which I feel a library should be able to do sensibly.

Without meaning to criticise (or at least, any further than I have done already :-) I find it very odd that this has apparently got brushed under the carpet. The only explanation that I can arrive at is that these days everybody is fixated on high-level protocols (WebSockets and so on) where annoying details like this are hidden from the application programmer.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018