Skip to content

std::io::net may need more thought #13537

Closed
@alexcrichton

Description

@alexcrichton

The net module has a few things which I would like to consider improving:

  • Must the Acceptor and Listener traits exists? It's a shame having to import the traits just to make a simple server.
  • Does the layout make sense? std::io::net::ip is quite long. Possibly a top-level net module? Possibly shorten using reexports?
  • What more needs to be exported? The current primitives implement the basic Reader/Writer traits, but not much beyond that. There are many methods provided by librustuv/libnative which are not exported. Need to make sure the signatures are correct.
  • "Unix pipes" are not unix pipes on windows (they are named pipes)

Wish list

  • TcpStream::open("google.com:80") does not work
  • I can clone a tcp stream, but I cannot close that duplicate tcp stream (from my owned stream)
  • Creating a server is quite wordy. There are a number of imports, lots of ip addr configuration, lots of listening/accepting, etc.

Nominating, I believe it is quite important to have a solid networking story.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions