sockets (ghc-5.04.1)

Volker Stolz vs@foldr.org
Fri, 7 Feb 2003 12:39:31 +0100


Am 06. Feb 2003 um 21:53 CET schrieb Peter Thiemann:
> and then duplicated part of my code. One thing that I found annoying
> was that the Protocol argument of
> Network.Socket.socket
> is not well specified. The type Protocol is abstract, but is a member
> of class Read. However, the Read syntax is nowhere specified. So I
> tried
> 
> do sock <- socket AF_UNIX Stream (read "0")
> 
> which works, but I'm sure that more informative strings work, too.

Hm, ghc-5.04.2 compiles
	sock <- socket AF_UNIX Stream 0
just fine. Are you maybe looking for Network.BSD.getProtocolBy*?
[ProtocolNumber is just a typdef for CInt]
-- 
Volker Stolz * http://www-i2.informatik.rwth-aachen.de/stolz/ * PGP * S/MIME
http://news.bbc.co.uk: `Israeli forces [...], declaring curfews that
confine more than 700,000 people to their homes.'