diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-12-05 18:19:06 -0800 | 
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-12-16 17:47:11 -0800 | 
| commit | 529e268ab900f1b6e731af64ce2aeecda3555f4e (patch) | |
| tree | 7ebb9ed2a7f36455b9550749a442522d45f0dc30 /src/libstd/io/net/unix.rs | |
| parent | bfa9064ba2687eb1d95708f72f41ddd9729a6ba1 (diff) | |
| download | rust-529e268ab900f1b6e731af64ce2aeecda3555f4e.tar.gz rust-529e268ab900f1b6e731af64ce2aeecda3555f4e.zip | |
Fallout of rewriting std::comm
Diffstat (limited to 'src/libstd/io/net/unix.rs')
| -rw-r--r-- | src/libstd/io/net/unix.rs | 25 | 
1 files changed, 10 insertions, 15 deletions
| diff --git a/src/libstd/io/net/unix.rs b/src/libstd/io/net/unix.rs index c1f75465d9c..d3fc265cf2a 100644 --- a/src/libstd/io/net/unix.rs +++ b/src/libstd/io/net/unix.rs @@ -152,25 +152,22 @@ mod tests { use super::*; use rt::test::*; use io::*; - use rt::comm::oneshot; fn smalltest(server: proc(UnixStream), client: proc(UnixStream)) { do run_in_mt_newsched_task { let path1 = next_test_unix(); let path2 = path1.clone(); - let (port, chan) = oneshot(); let (client, server) = (client, server); + let (port, chan) = Chan::new(); do spawntask { let mut acceptor = UnixListener::bind(&path1).listen(); chan.send(()); - server(acceptor.accept().unwrap()); + server.take()(acceptor.accept().unwrap()); } - do spawntask { - port.recv(); - client(UnixStream::connect(&path2).unwrap()); - } + port.recv(); + client.take()(UnixStream::connect(&path2).unwrap()); } } @@ -251,7 +248,7 @@ mod tests { let times = 10; let path1 = next_test_unix(); let path2 = path1.clone(); - let (port, chan) = oneshot(); + let (port, chan) = Chan::new(); do spawntask { let mut acceptor = UnixListener::bind(&path1).listen(); @@ -264,13 +261,11 @@ mod tests { }) } - do spawntask { - port.recv(); - times.times(|| { - let mut stream = UnixStream::connect(&path2); - stream.write([100]); - }) - } + port.recv(); + times.times(|| { + let mut stream = UnixStream::connect(&path2); + stream.write([100]); + }) } } | 
