Bug 542700 - Allow host name in clients
Summary: Allow host name in clients
Status: NEW
Alias: None
Product: 4DIAC
Classification: IoT
Component: FORTE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-12 04:35 EST by Jose Maria Jesus Cabral Lassalle CLA
Modified: 2018-12-12 06:00 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jose Maria Jesus Cabral Lassalle CLA 2018-12-12 04:35:23 EST
What I want to do is to use a client to connect to some server, but I don't want to use the IP address (x.x.x.x:y) but use the host name as my.server.com:4566.

This is platform dependant, that's why I'm opening the bug to discuss how to approach (or even if it's actually necessary). I stumble upon this problem when trying to connect using HTTP to some server, whose ip address wasn't fix, but the hostname was. 

I know there's a "getaddrinfo" function in posix, but I'm not sure yet how to handle this.

I could add this functionality first in the HTTP module with platform dependant code to reduce the effects of it.
Comment 1 Alois Zoitl CLA 2018-12-12 05:43:11 EST
This is an issue we know already for quite some time. See also the bug in the old bug tracker [1]. Ingo spent some time on it and it turned out it is not as easy as it seemed in the start. Therefore I think haveing a firs version just for the HTTP could be a good starting point to learn more about it.

[1] https://sourceforge.net/p/fordiac/issues/443/
Comment 2 Martin Melik-Merkumians CLA 2018-12-12 05:53:46 EST
But why put it into the HTTP module?
In order to get the correct error responses for Windows and BSD compatible network interfaces, we already introduced platform dependent code blocks in the arch. Why not extend it to provide this functionality?

Also I just checked the function for BSD (Beej's Guide) and in the Windows WinSock reference. On the first look, they seem to have the same interface, so where is the platform dependence?
Even the returned struct is exactly alike.
Comment 3 Jose Maria Jesus Cabral Lassalle CLA 2018-12-12 05:58:59 EST
I thought doing it in HTTP to avoid unexpected crashes. But the changes could be done in a spawned branch from develop to avoid unstability in develop until it's properly tested
Comment 4 Martin Melik-Merkumians CLA 2018-12-12 06:00:29 EST
Oh, I see.
I prefer the additional branch approach, as it minimizes rework as soon as the feature is finished.