Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uphow to reuse TcpStream code from src/sys/windows/tcp.rs ? #578
Comments
This comment has been minimized.
This comment has been minimized.
|
I'd recommend taking a look at mio-named-pipes which are named pipes for mio, which you'll also likely want to mirror. In general though yes, you'll want to copy code from tcp.rs and adapt it as appropriate, it won't ever be publicly exposed from mio itself. |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton I looked at mio-named-pipes, looks a lot of code duplication For example, why not just call in |
This comment has been minimized.
This comment has been minimized.
|
I don't think we are going to extract that as an official mio API. The main
reason is that it creates additional API surface to support and resources
are thin.
However. Feel free to extract those bits to another crate.
…On Mon, Mar 27, 2017 at 8:40 AM Evgeniy Dushistov ***@***.***> wrote:
@alexcrichton <https://github.com/alexcrichton> I looked at
mio-named-pipes, looks a lot of code duplication
with mio/sys/windows, do you have plans refactoring?
For example, why not just call in Binding::register_socket/register_handle
approapriate schedule functions?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#578 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAYJCU3OFF5bzmAlkc-kOHBaVohMYWuks5rp9hbgaJpZM4MpV-4>
.
|
This comment has been minimized.
This comment has been minimized.
|
Currently no I don't plan on deduplicating, I'd personally prefer the freedom to change TCP bindings in mio itself and then at my leisure update other bindings. Exposing an API as a public interface would require everything to change all at once (and would make it very difficult to change) |
Dushistov commentedMar 26, 2017
•
edited
cc @alexcrichton @carllerche
I want to work with
AF_BTHsocket on windows OS,to demonstrate what I am talking about here some code (blocking variant):
As I understand comments from lib.rs and windows mod.rs I basically need not only use
windows::Bindingto imlementmio::Eventd, but also startsI/Owith overlapped structures on readiness request, so basicaly copy/paste code from windows/tcp.rs and modify for my need, am I right?If so, do you accept PR that generalize windows/tcp.rs to any
SOCK_STREAMand allow some kind of user defined connect and socket creation functions?