|
|
|
@ -101,7 +101,7 @@ mod tests {
|
|
|
|
|
.map_err(|x| io::Error::new(io::ErrorKind::Other, x))?;
|
|
|
|
|
|
|
|
|
|
// Get first connection
|
|
|
|
|
let mut conn_1 = listener.accept().await?;
|
|
|
|
|
let conn_1 = listener.accept().await?;
|
|
|
|
|
|
|
|
|
|
// Send some data to the first connection (12 bytes)
|
|
|
|
|
conn_1.write_all(b"hello conn 1").await?;
|
|
|
|
@ -112,7 +112,7 @@ mod tests {
|
|
|
|
|
assert_eq!(&buf, b"hello server 1");
|
|
|
|
|
|
|
|
|
|
// Get second connection
|
|
|
|
|
let mut conn_2 = listener.accept().await?;
|
|
|
|
|
let conn_2 = listener.accept().await?;
|
|
|
|
|
|
|
|
|
|
// Send some data on to second connection (12 bytes)
|
|
|
|
|
conn_2.write_all(b"hello conn 2").await?;
|
|
|
|
@ -131,7 +131,7 @@ mod tests {
|
|
|
|
|
// Connect to the listener twice, sending some bytes and receiving some bytes from each
|
|
|
|
|
let mut buf: [u8; 12] = [0; 12];
|
|
|
|
|
|
|
|
|
|
let mut conn = WindowsPipeTransport::connect_local(&name)
|
|
|
|
|
let conn = WindowsPipeTransport::connect_local(&name)
|
|
|
|
|
.await
|
|
|
|
|
.expect("Conn 1 failed to connect");
|
|
|
|
|
conn.write_all(b"hello server 1")
|
|
|
|
@ -142,7 +142,7 @@ mod tests {
|
|
|
|
|
.expect("Conn 1 failed to read");
|
|
|
|
|
assert_eq!(&buf, b"hello conn 1");
|
|
|
|
|
|
|
|
|
|
let mut conn = WindowsPipeTransport::connect_local(&name)
|
|
|
|
|
let conn = WindowsPipeTransport::connect_local(&name)
|
|
|
|
|
.await
|
|
|
|
|
.expect("Conn 2 failed to connect");
|
|
|
|
|
conn.write_all(b"hello server 2")
|
|
|
|
|