kobo / groovyserv

Groovy's startup acceralator.
http://kobo.github.io/groovyserv/
Other
98 stars 10 forks source link

caused a freeze when reading from stdin on Linux #44

Closed nobeans closed 11 years ago

nobeans commented 11 years ago

from YongKi:

First of all I'd like to thank you very much for your groovyserver. I'm really impressed what you've done for groovy startup speed. It's literally innovative.

However one big problem makes me hesitate to use your great work. It's the console-input problem.

I wonder whether you were reported or not, but I urge you try this source with groovyclient:

System.in.withReader { print "Where to go? " input = it.readLine() println input } Once you run the script, you will soon indicate that the waiting prompt for the input stream won't stop. It keeps blinks and wait until you try to exit program with 'Ctrl+C'

I think I woud be possible to fix the problem by myself because you kindly shared the sources to public. But I think it would be better to ask you about the issue in advance.` Thank you again and hope to receive any reply for this thing.

nobeans commented 11 years ago

It's caused by a different behavior of 'recv' function for different environments. http://stackoverflow.com/questions/5994724/recv-with-length-zero-is-valid

nobeans commented 11 years ago

fixed.