[Haskell-cafe] UDP

Stephan Friedrichs deduktionstheorem at web.de
Sat Jan 31 16:19:47 EST 2009


Andrew Coppin wrote:
> I'm trying to write a simple program that involves UDP. I was hoping
> something like this would work:
> 
> [...]

How about using bindSocket? At least that's the main difference between
your code snippet and our (UDP-using) barracuda project :)

> 
> main2 = do
>  s <- socket AF_INET Datagram defaultProtocol
  bindSocket s ...
>  putStrLn "Waiting..."
>  x <- recv s 100
>  putStrLn x
> 
> [...]
> 

//Stephan

-- 

Früher hieß es ja: Ich denke, also bin ich.
Heute weiß man: Es geht auch so.

 - Dieter Nuhr


More information about the Haskell-Cafe mailing list