mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 11:15:38 -05:00
lwt test
This commit is contained in:
parent
cf6b20a979
commit
a1814cadb4
5 changed files with 19 additions and 13 deletions
|
|
@ -211,8 +211,9 @@ let main ~port ~runner () : unit Lwt.t =
|
||||||
Trace.message "exit handle client"
|
Trace.message "exit handle client"
|
||||||
in
|
in
|
||||||
|
|
||||||
let addr = Unix.ADDR_INET (Unix.inet_addr_any, port) in
|
let addr = Unix.ADDR_INET (Unix.inet_addr_loopback, port) in
|
||||||
let _server = M_lwt.TCP_server.establish_lwt ~runner addr handle_client in
|
let _server = M_lwt.TCP_server.establish_lwt ~runner addr handle_client in
|
||||||
|
Printf.printf "listening on port=%d\n%!" port;
|
||||||
|
|
||||||
lwt_fut
|
lwt_fut
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
listening on port 1235
|
run echo server on port=12346
|
||||||
run echo client -p 1235 -n 10 --n-conn=2 -j=4
|
listening on port 12346
|
||||||
|
run echo client -p 12346 -n 10 --n-conn=2 -j=4
|
||||||
all done
|
all done
|
||||||
connecting to port 1235
|
connecting to port 12346
|
||||||
read: hello 1
|
read: hello 1
|
||||||
read: hello 1
|
read: hello 1
|
||||||
read: hello 1
|
read: hello 1
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
listening on port 1234
|
running hash server on port=12345
|
||||||
run hash client -p 1234 -d ../data/ --n-conn=2 -j=4
|
listening on port 12345
|
||||||
|
listening on port=12345
|
||||||
|
run hash client -p 12345 -d ../data/ --n-conn=2 -j=4
|
||||||
../data/d1/large: fdb479c5661572f9606266eeb280b4db5c26cc38
|
../data/d1/large: fdb479c5661572f9606266eeb280b4db5c26cc38
|
||||||
../data/d1/large: fdb479c5661572f9606266eeb280b4db5c26cc38
|
../data/d1/large: fdb479c5661572f9606266eeb280b4db5c26cc38
|
||||||
../data/d1/large_10: c31560efa1a5ad6dbf89990d51878f3bd64b13ce
|
../data/d1/large_10: c31560efa1a5ad6dbf89990d51878f3bd64b13ce
|
||||||
|
|
@ -440,5 +442,5 @@ run hash client -p 1234 -d ../data/ --n-conn=2 -j=4
|
||||||
../data/d9/large_9: 7893508ace6bc8a4d65e03ebf88a9be6c188af17
|
../data/d9/large_9: 7893508ace6bc8a4d65e03ebf88a9be6c188af17
|
||||||
../data/d9/smol: 31416013d3060b8056a601c9f6719e94e7e9f7ed
|
../data/d9/smol: 31416013d3060b8056a601c9f6719e94e7e9f7ed
|
||||||
../data/d9/smol: 31416013d3060b8056a601c9f6719e94e7e9f7ed
|
../data/d9/smol: 31416013d3060b8056a601c9f6719e94e7e9f7ed
|
||||||
connecting to port 1234
|
connecting to port 12345
|
||||||
hash dir="../data/"
|
hash dir="../data/"
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
PORT=1235
|
PORT=12346
|
||||||
|
echo "run echo server on port=$PORT"
|
||||||
./echo_server.exe -p $PORT &
|
./echo_server.exe -p $PORT &
|
||||||
if [ "x$?" != x0 ]; then exit 1 ; fi
|
if [ "x$?" != x0 ]; then exit 1 ; fi
|
||||||
|
|
||||||
|
|
||||||
sleep 0.9
|
sleep 2
|
||||||
echo "run echo client -p $PORT $@"
|
echo "run echo client -p $PORT $*"
|
||||||
|
|
||||||
export LC_LANG=C
|
export LC_LANG=C
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
./echo_client.exe -p $PORT $@ | sort
|
./echo_client.exe -p $PORT "$@" | sort
|
||||||
|
|
||||||
kill %1
|
kill %1
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
PORT=1234
|
PORT=12345
|
||||||
|
echo "running hash server on port=$PORT"
|
||||||
./hash_server.exe -p $PORT &
|
./hash_server.exe -p $PORT &
|
||||||
if [ "x$?" != x0 ]; then exit 1 ; fi
|
if [ "x$?" != x0 ]; then exit 1 ; fi
|
||||||
|
|
||||||
sleep 0.9
|
sleep 2
|
||||||
echo "run hash client -p $PORT $@"
|
echo "run hash client -p $PORT $@"
|
||||||
|
|
||||||
export LC_LANG=C
|
export LC_LANG=C
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue