read input socket until no byte is available (-1)