socket TChan problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

socket TChan problem

Stefan Aeschbacher
Hi

I try to write a program that reads from a socket and communicates
the result over a TChan and writes it to stdout. Somehow I can't seem to get it right,
the result is only printed when I send ETX on the socket.

Attached is a sample program that shows the behvaviour.

Any hints on where my error is or how I could debug such a problem is appreciated.

regards

Stefan

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Main.hs (876 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: socket TChan problem

Stefan Aeschbacher
Hi

I think I finally found the problem. I had to replace the call to usleep with a call to threadDelay and it worked.

regards

Stefan


2006/2/27, Stefan Aeschbacher <[hidden email]>:
Hi

I try to write a program that reads from a socket and communicates
the result over a TChan and writes it to stdout. Somehow I can't seem to get it right,
the result is only printed when I send ETX on the socket.

Attached is a sample program that shows the behvaviour.

Any hints on where my error is or how I could debug such a problem is appreciated.

regards

Stefan



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: socket TChan problem

Anatoly Zaretsky
Why do you need to duplicate channels?
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: socket TChan problem

Stefan Aeschbacher
Hi

Actually I don't need to duplicate them, it's an oversight from my side when I converted my code from my own channels to TChan.

regards

Stefan

Am 28.02.06 schrieb Anatoly Zaretsky <[hidden email]>:
Why do you need to duplicate channels?
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe