خرید بک لینک

Vote count: 0

The problem I'm trying to solve is using io.Reader and io.Writer in a net application without using bufio and strings as per the examples I've been able to find online. For efficiency I'm trying to avoid the memcopys those imply.

I've created a test application using net.Pipe on the play area (https://play.golang.org/p/-7YDs1uEc5). There is a data source and sink which talk through a net.Pipe pair of coections (to model a network coection) and a loopback on the far end to reflect the data right back at us.

The program gets as far as the loopback agent reading the sent data, but as far as I can see the write back to the coection locks; it certainly never completes. Additionally the receiver in the Sink never receives any data whatsoever.

I can't figure out why the write caot proceed as it's wholly symmetrical with the path that does work. I've written other test systems that use bi-directional network coections but as soon as I stop using bufio and ReadString I encounter this problem. I've looked at the code of those and can't see what I've missed.

Thanks in advance for any help.

asked 59 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 17 شهريور 1395 ساعت: 0:38

صفحه بندی