<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libstd/sys/unix/net.rs, branch 1.2.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.2.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.2.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2015-05-29T03:03:20+00:00</updated>
<entry>
<title>Implement RFC 1047 - socket timeouts</title>
<updated>2015-05-29T03:03:20+00:00</updated>
<author>
<name>Steven Fackler</name>
<email>sfackler@gmail.com</email>
</author>
<published>2015-05-27T06:47:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=69a0e1af9553ad50ee2d9c9176470ddeef70717c'/>
<id>urn:sha1:69a0e1af9553ad50ee2d9c9176470ddeef70717c</id>
<content type='text'>
Closes #25619
</content>
</entry>
<entry>
<title>std: Set CLOEXEC for all fds opened on unix</title>
<updated>2015-04-10T00:07:02+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2015-04-03T22:30:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d6c72306c8fc2ec0fd9d6e499c32f2bf52f0b8ba'/>
<id>urn:sha1:d6c72306c8fc2ec0fd9d6e499c32f2bf52f0b8ba</id>
<content type='text'>
This commit starts to set the CLOEXEC flag for all files and sockets opened by
the standard library by default on all unix platforms. There are a few points of
note in this commit:

* The implementation is not 100% satisfactory in the face of threads. File
  descriptors only have the `F_CLOEXEC` flag set *after* they are opened,
  allowing for a fork/exec to happen in the middle and leak the descriptor.
  Some platforms do support atomically opening a descriptor while setting the
  `CLOEXEC` flag, and it is left as a future extension to bind these apis as it
  is unclear how to do so nicely at this time.

* The implementation does not offer a method of opting into the old behavior of
  not setting `CLOEXEC`. This will possibly be added in the future through
  extensions on `OpenOptions`, for example.

* This change does not yet audit any Windows APIs to see if the handles are
  inherited by default by accident.

This is a breaking change for users who call `fork` or `exec` outside of the
standard library itself and expect file descriptors to be inherted. All file
descriptors created by the standard library will no longer be inherited.

[breaking-change]
</content>
</entry>
<entry>
<title>rollup merge of #23919: alexcrichton/stabilize-io-error</title>
<updated>2015-03-31T23:18:55+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2015-03-31T23:18:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=50b3ecf3bcc2e39a7a42e7f4b49f19398d5cc681'/>
<id>urn:sha1:50b3ecf3bcc2e39a7a42e7f4b49f19398d5cc681</id>
<content type='text'>
Conflicts:
	src/libstd/fs/tempdir.rs
	src/libstd/io/error.rs
</content>
</entry>
<entry>
<title>std: Stabilize last bits of io::Error</title>
<updated>2015-03-31T23:12:48+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2015-03-31T23:01:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ac77392f8ab1c201b0c927f6a2d30b632b95acda'/>
<id>urn:sha1:ac77392f8ab1c201b0c927f6a2d30b632b95acda</id>
<content type='text'>
This commit stabilizes a few remaining bits of the `io::Error` type:

* The `Error::new` method is now stable. The last `detail` parameter was removed
  and the second `desc` parameter was generalized to `E: Into&lt;Box&lt;Error&gt;&gt;` to
  allow creating an I/O error from any form of error. Currently there is no form
  of downcasting, but this will be added in time.

* An implementation of `From&lt;&amp;str&gt; for Box&lt;Error&gt;` was added to liballoc to
  allow construction of errors from raw strings.

* The `Error::raw_os_error` method was stabilized as-is.

* Trait impls for `Clone`, `Eq`, and `PartialEq` were removed from `Error` as it
  is not possible to use them with trait objects.

This is a breaking change due to the modification of the `new` method as well as
the removal of the trait implementations for the `Error` type.

[breaking-change]
</content>
</entry>
<entry>
<title>std: Stabilize parts of std::os::platform::io</title>
<updated>2015-03-26T23:40:36+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2015-03-26T23:18:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6370f2978e485fd46bcb64f51a1c003395acfedc'/>
<id>urn:sha1:6370f2978e485fd46bcb64f51a1c003395acfedc</id>
<content type='text'>
This commit stabilizes the platform-specific `io` modules, specifically around
the traits having to do with the raw representation of each object on each
platform.

Specifically, the following material was stabilized:

* `AsRaw{Fd,Socket,Handle}`
* `RawFd` (renamed from `Fd`)
* `RawHandle` (renamed from `Handle`)
* `RawSocket` (renamed from `Socket`)
* `AsRaw{Fd,Socket,Handle}` implementations
* `std::os::{unix, windows}::io`

The following material was added as `#[unstable]`:

* `FromRaw{Fd,Socket,Handle}`
* Implementations for various primitives

There are a number of future improvements that are possible to make to this
module, but this should cover a good bit of functionality desired from these
modules for now. Some specific future additions may include:

* `IntoRawXXX` traits to consume the raw representation and cancel the
  auto-destructor.
* `Fd`, `Socket`, and `Handle` abstractions that behave like Rust objects and
  have nice methods for various syscalls.

At this time though, these are considered backwards-compatible extensions and
will not be stabilized at this time.

This commit is a breaking change due to the addition of `Raw` in from of the
type aliases in each of the platform-specific modules.

[breaking-change]
</content>
</entry>
<entry>
<title>std: Stabilize the `net` module</title>
<updated>2015-03-13T23:47:42+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2015-03-13T21:22:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f798674b86382929ca17c88de422a6e2fdb27f2a'/>
<id>urn:sha1:f798674b86382929ca17c88de422a6e2fdb27f2a</id>
<content type='text'>
This commit performs a stabilization pass over the std::net module,
incorporating the changes from RFC 923. Specifically, the following actions were
taken:

Stable functionality:

* `net` (the name)
* `Shutdown`
* `Shutdown::{Read, Write, Both}`
* `lookup_host`
* `LookupHost`
* `SocketAddr`
* `SocketAddr::{V4, V6}`
* `SocketAddr::port`
* `SocketAddrV4`
* `SocketAddrV4::{new, ip, port}`
* `SocketAddrV6`
* `SocketAddrV4::{new, ip, port, flowinfo, scope_id}`
* Common trait impls for socket addr structures
* `ToSocketAddrs`
* `ToSocketAddrs::Iter`
* `ToSocketAddrs::to_socket_addrs`
* `ToSocketAddrs for {SocketAddr*, (Ipv*Addr, u16), str, (str, u16)}`
* `Ipv4Addr`
* `Ipv4Addr::{new, octets, to_ipv6_compatible, to_ipv6_mapped}`
* `Ipv6Addr`
* `Ipv6Addr::{new, segments, to_ipv4}`
* `TcpStream`
* `TcpStream::connect`
* `TcpStream::{peer_addr, local_addr, shutdown, try_clone}`
* `{Read,Write} for {TcpStream, &amp;TcpStream}`
* `TcpListener`
* `TcpListener::bind`
* `TcpListener::{local_addr, try_clone, accept, incoming}`
* `Incoming`
* `UdpSocket`
* `UdpSocket::bind`
* `UdpSocket::{recv_from, send_to, local_addr, try_clone}`

Unstable functionality:

* Extra methods on `Ipv{4,6}Addr` for various methods of inspecting the address
  and determining qualities of it.
* Extra methods on `TcpStream` to configure various protocol options.
* Extra methods on `UdpSocket` to configure various protocol options.

Deprecated functionality:

* The `socket_addr` method has been renamed to `local_addr`

This commit is a breaking change due to the restructuring of the `SocketAddr`
type as well as the renaming of the `socket_addr` method. Migration should be
fairly straightforward, however, after accounting for the new level of
abstraction in `SocketAddr` (protocol distinction at the socket address level,
not the IP address).

[breaking-change]
</content>
</entry>
<entry>
<title>std: Implement CString-related RFCs</title>
<updated>2015-02-18T22:15:43+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2015-02-18T06:47:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1860ee521aa6096eb7f5410a64b53311fb0d2d0e'/>
<id>urn:sha1:1860ee521aa6096eb7f5410a64b53311fb0d2d0e</id>
<content type='text'>
This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These
two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type
to the module.

[r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md
[r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md

The new `CStr` type is only constructable via two methods:

1. By `deref`'ing from a `CString`
2. Unsafely via `CStr::from_ptr`

The purpose of `CStr` is to be an unsized type which is a thin pointer to a
`libc::c_char` (currently it is a fat pointer slice due to implementation
limitations). Strings from C can be safely represented with a `CStr` and an
appropriate lifetime as well. Consumers of `&amp;CString` should now consume `&amp;CStr`
instead to allow producers to pass in C-originating strings instead of just
Rust-allocated strings.

A new constructor was added to `CString`, `new`, which takes `T: IntoBytes`
instead of separate `from_slice` and `from_vec` methods (both have been
deprecated in favor of `new`). The `new` method returns a `Result` instead of
panicking.  The error variant contains the relevant information about where the
error happened and bytes (if present). Conversions are provided to the
`io::Error` and `old_io::IoError` types via the `FromError` trait which
translate to `InvalidInput`.

This is a breaking change due to the modification of existing `#[unstable]` APIs
and new deprecation, and more detailed information can be found in the two RFCs.
Notable breakage includes:

* All construction of `CString` now needs to use `new` and handle the outgoing
  `Result`.
* Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call.
* The `as_slice*` methods have been removed in favor of just having the
  `as_bytes*` methods.

Closes #22469
Closes #22470
[breaking-change]
</content>
</entry>
<entry>
<title>std: Add a `net` module for TCP/UDP</title>
<updated>2015-02-11T23:23:34+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2015-02-06T00:50:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=395709ca6d39ba1e095e404e1d2a169d918b7f0c'/>
<id>urn:sha1:395709ca6d39ba1e095e404e1d2a169d918b7f0c</id>
<content type='text'>
This commit is an implementation of [RFC 807][rfc] which adds a `std::net`
module for basic neworking based on top of `std::io`. This module serves as a
replacement for the `std::old_io::net` module and networking primitives in
`old_io`.

[rfc]: fillmein

The major focus of this redesign is to cut back on the level of abstraction to
the point that each of the networking types is just a bare socket. To this end
functionality such as timeouts and cloning has been removed (although cloning
can be done through `duplicate`, it may just yield an error).

With this `net` module comes a new implementation of `SocketAddr` and `IpAddr`.
This work is entirely based on #20785 and the only changes were to alter the
in-memory representation to match the `libc`-expected variants and to move from
public fields to accessors.
</content>
</entry>
</feed>
