bytedance/monoio

A new trait for Socket

Closed this issue · 2 comments

Is your feature request related to a problem? Please describe.
I am trying to implement AsyncWriteRent for File, but the signature shutdown defined in this trait is used to shutdown a socket connection, which is needless for File.

Describe the solution you'd like
IMO, there could be something like SocketShutdown.

Describe alternatives you've considered
It can also do nothing in the implement of File and using docs to tell user about why, but a little bit wired.

@Xuanwo @ihciah any idea?

I think it can be aligned with tokio. In tokio's file impl it impl poll_shutdown as poll_flush.