Skip to content

Commit 09a561a

Browse files
committed
auto merge of #11186 : alexcrichton/rust/native-udp, r=brson
I personally do not have huge amounts of experience in this area, so there's likely a thing or two wrong around the edges. I tried to just copy what libuv is doing as closely as possible with a few tweaks in a few places, but all of the `std::io::net::udp` tests are now run in both native and green settings so the published functionality is all being tested.
2 parents 1dcc986 + bba78a2 commit 09a561a

File tree

4 files changed

+379
-113
lines changed

4 files changed

+379
-113
lines changed

src/libnative/io/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ impl rtio::IoFactory for IoFactory {
166166
fn tcp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpListener> {
167167
net::TcpListener::bind(addr).map(|s| ~s as ~RtioTcpListener)
168168
}
169-
fn udp_bind(&mut self, _addr: SocketAddr) -> IoResult<~RtioUdpSocket> {
170-
Err(unimpl())
169+
fn udp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioUdpSocket> {
170+
net::UdpSocket::bind(addr).map(|u| ~u as ~RtioUdpSocket)
171171
}
172172
fn unix_bind(&mut self, _path: &CString) -> IoResult<~RtioUnixListener> {
173173
Err(unimpl())

0 commit comments

Comments
 (0)