that the Read implementation for TcpStream in only reads two bytes at a time and read_to_string is like read_to_end, so it waits for EOF. There is no read_line.

@Koehr Are you looking for trait std::io::BufRead?

@kmk exactly. It's not implemented for TcpStream so I just wrote it on my own.

@Koehr BufReader is supposed to wrap any Read into a BufRead. TcpStream is a Read so it should work with. Doesn't it?

Follow

@kmk maybe I'm just too stupid to use it the right way. I'll check it out. thanks.

Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!