
28 Jun
2005
28 Jun
'05
1:38 p.m.
Is there any good reason why I can get a bound socket's port with getPortSocket, but cannot get its host address (ie, IP number)? Sure, this makes only sense for ip sockets, but there it is sometimes crucial to get at this information. I can get the information using the lower-level Network.Socket using
SockAddrInet _ hostAddr <- getSocketName socket host <- inet_ntoa hostAddr
but I think that this is the kind of information that needs to be available in the high-level interface, too. BTW, shouldn't Network also reexport constants, such as aNY_PORT and iNADDR_ANY. Manuel