A colleague recently discovered that he is unable to use Warp with hostnames (such as "localhost"); it only works with IP addresses.
runSettings calls bindPortTCP (source)
bindPortTCP calls bindPortGen (source)
bindPortGen calls bindPortGenEx (source)
bindPortGenEx sets the NS.AI_NUMERICHOST hint (source), which limits hosts to numeric addresses
Is this a desired limitation? If so, perhaps it should be documented, as none of the above functions have documentation that mentions it. If not, would removing the NS.AI_NUMERICHOST hint be an acceptable fix, or would that have undesired consequences for other uses of the function?
Note that the limitation can be easily worked around by resolving hostnames before configuring the Warp settings.
For anybody who runs across this issue and searches for it, here is the error message:
Network.Socket.getAddrInfo (called with
preferred socket type/protocol: AddrInfo
{ addrFlags = [AI_PASSIVE,AI_NUMERICSERV,AI_NUMERICHOST]
, addrFamily = AF_UNSPEC
, addrSocketType = Stream
, addrProtocol = 0
, addrAddress = <assumed to be undefined>
, addrCanonName = <assumed to be undefined>
},
host name: Just "localhost",
service name: Just "8000"):
does not exist (Name or service not known)
A colleague recently discovered that he is unable to use Warp with hostnames (such as "localhost"); it only works with IP addresses.
runSettingscallsbindPortTCP(source)bindPortTCPcallsbindPortGen(source)bindPortGencallsbindPortGenEx(source)bindPortGenExsets theNS.AI_NUMERICHOSThint (source), which limits hosts to numeric addressesIs this a desired limitation? If so, perhaps it should be documented, as none of the above functions have documentation that mentions it. If not, would removing the
NS.AI_NUMERICHOSThint be an acceptable fix, or would that have undesired consequences for other uses of the function?Note that the limitation can be easily worked around by resolving hostnames before configuring the Warp settings.
For anybody who runs across this issue and searches for it, here is the error message: