-
Notifications
You must be signed in to change notification settings - Fork 18k
net: export writeBuffers() and buffersWriter #21756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Comments
Hidden behavior that is difficult to use right. |
Looks similar to #21676 in which @zombiezen talks about how frustrating it is that writeBuffers is unexported. |
Sorry, for open/reopen spam ) Should I close it as a duplicate or keep it opened until Go1.11? |
The two seem slightly different, let's keep them both for now. |
After more thought, closing as dup of #21676 . |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Hello!
Looking at
net.Buffers.WriteTo()
implementation one can find that it uses type assertion to non-exported typenet.buffersWriter
. The proposal is to export this type and methods which implement it.Two things:
net.Conn
to get some i/o statistics, say:It becomes impossible to use
writev()
syscall –ConnWatcher
has no way to implement non-exportednet.buffersWriter
interface.*net.TCPConn
(rare case, but possible) to decorate some write behaviour:The last line of the example above
bs.WriteTo(cc)
will producecc.TCPConn.writeBuffers(bs)
call, sending raw data without encoding.Regards,
Sergey.
The text was updated successfully, but these errors were encountered: