Skip to content

Commit a226f56

Browse files
Gealalexcrichton
authored andcommitted
Implement Unix domain sockets in libnative
1 parent c848906 commit a226f56

File tree

4 files changed

+387
-2
lines changed

4 files changed

+387
-2
lines changed

src/libnative/io/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ impl rtio::IoFactory for IoFactory {
197197
net::UdpSocket::bind(addr).map(|u| ~u as ~RtioUdpSocket)
198198
}
199199
fn unix_bind(&mut self, _path: &CString) -> IoResult<~RtioUnixListener> {
200-
Err(unimpl())
200+
net::UnixListener::bind(_path).map(|s| ~s as ~RtioUnixListener)
201201
}
202202
fn unix_connect(&mut self, _path: &CString) -> IoResult<~RtioPipe> {
203-
Err(unimpl())
203+
net::UnixStream::connect(_path, libc::SOCK_STREAM).map(|s| ~s as ~RtioPipe)
204204
}
205205
fn get_host_addresses(&mut self, host: Option<&str>, servname: Option<&str>,
206206
hint: Option<ai::Hint>) -> IoResult<~[ai::Info]> {

0 commit comments

Comments
 (0)