sock_readline: implement