fix wasm websocket

This commit is contained in:
John Smith
2022-01-05 19:15:45 -05:00
parent ea2300c32b
commit 2eb598e68c
2 changed files with 16 additions and 20 deletions

View File

@@ -1,11 +1,12 @@
use crate::xx::*;
use core::time::Duration;
static MESSAGE: &[u8; 62] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
use async_std::io;
use async_std::net::{TcpListener, TcpStream};
use async_std::prelude::*;
use async_std::task;
use std::time::Duration;
static MESSAGE: &[u8; 62] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
async fn make_tcp_loopback() -> Result<(TcpStream, TcpStream), io::Error> {
let listener = TcpListener::bind("127.0.0.1:0").await?;
@@ -35,13 +36,13 @@ async fn make_async_peek_stream_loopback() -> (AsyncPeekStream, AsyncPeekStream)
(aps_a, aps_c)
}
async fn make_tcpstream_loopback() -> (TcpStream, TcpStream) {
async fn make_stream_loopback() -> (TcpStream, TcpStream) {
make_tcp_loopback().await.unwrap()
}
pub async fn test_nothing() {
info!("test_nothing");
let (mut a, mut c) = make_tcpstream_loopback().await;
let (mut a, mut c) = make_stream_loopback().await;
let outbuf = MESSAGE.to_vec();
a.write_all(&outbuf).await.unwrap();