balip, don't use line input, if you want mý advice, use binary and get it in chunks instead

Did you try out strconv?