It's amazing! But I'm surprised no one else has this problem, as I assume using network + lazy bytestrings is quite frequent when you want to do network programming in Haskell.
BTW, you may not have the same libraries versions as me. Maybe this problems doesn't occur in older versions of bytestring or network. I have the last versions : - network-2.2.1.7 - bytestring-0.9.1.6 (and binary-0.5.0.2, but the simple example showed that the problem came from deeper than it) Daniel Fischer-4 wrote: > > Am Mittwoch 07 April 2010 21:53:20 schrieb Daniel Fischer: >> Am Mittwoch 07 April 2010 20:43:24 schrieb Yves Parès: >> > Yes, from what I read, I assumed it had this behavior. >> > But, then, I don't see why the server holds... >> > I've posted a mail on Haskell-Cafe called "Network: buffering >> > troubles", in which I put a smaller example which reproduces this >> > problem. >> >> I know :) >> >> I have now tested it, with both (simple) servers and I can't reproduce >> the problem (ghc-6.12.1 and ghc-6.10.3). > > Installed binary-protocol and tried the original (no hSetBuffering), that > also works flawlessly (ghc-6.12.1 on openSuSE 11.1). > > Server: > $ ../BeginnersTesting/Server > I wait for a client... > Result: Just 1.6190478 > I wait for a client... > Result: Just 12.0 > I wait for a client... > Result: Nothing > ^C > > Client: > $ ./Client localhost > Operation? > Operation 3.4 Div 2.1 > Operation sent. > 1.6190478 > Operation? > Operation 17 Minus 5 > Operation sent. > 12.0 > Operation? > Stop > Operation sent. > > > Seems to be something with Ubuntu. > Maybe somebody else on Ubuntu could test it? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > ----- Yves Parès Live long and prosper -- View this message in context: http://old.nabble.com/Simple-binary-protocol-through-network-test-tp28157883p28174807.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe