linux gethostbyname

Moderators: heatherlaine, Klaus, FourthWorld, kevinmiller, LCMark

Post Reply
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2690
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

linux gethostbyname

Post by mwieder » Thu Apr 12, 2018 3:50 am

I've got working code to fix hostnameToAddress() on linux (bug #5909) but I'm not sure where to plug it in.

Tracing through the code, it seems the lowest common denominator would be to hook MCSocketHostNameResolve(), but I'm reluctant to mess with socket issues down at that level because unexpected side-effects.
The high-level approach would be to hook it into MCNetworkEvalHostNameToAddress() instead, replacing *all* the existing code in that function if the platform is linux, but that would mean not being able to leverage any existing lower-level code.

The socket code is pretty messy.
My code, while under 100 lines, is completely standalone and makes no use of any other engine code, so it doesn't seem like making the socket code even messier is the best way to attack the problem. So I'm looking for suggestions as to what direction to move in.

I've also found that there are various #defines sprinkled through the code, and I'm wondering if we can maybe condense these down to just one for sanity:

LINUX
_LINUX
TARGET_PLATFORM_LINUX
PLATFORM_LINUX

we also have
_LINUX_DESKTOP
_LINUX_SERVER
PLATFORM_LINUXMOBILE

That last one, while possibly interesting, also seems to be unused, as is PLATFORM_WINMOBILE.

bogs
Posts: 2073
Joined: Sat Feb 25, 2017 10:45 pm

Re: linux gethostbyname

Post by bogs » Thu Apr 12, 2018 5:00 am

mwieder wrote:
Thu Apr 12, 2018 3:50 am
...PLATFORM_LINUXMOBILE
That last one, while possibly interesting, also seems to be unused, as is PLATFORM_WINMOBILE.
I wish I had an answer for you :oops: but that last one made me remember there were more than a few attempts to move straight up linux to mobile, probably the best known attempt was made by Ubuntu. Fun times that :D
Image

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2690
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: linux gethostbyname

Post by mwieder » Thu Apr 12, 2018 5:44 am

Yeah, I still want my ubuntu phone. :shock:

Post Reply

Return to “Engine Contributors”