diff --git a/basis/io/unix/sockets/sockets.factor b/basis/io/unix/sockets/sockets.factor index 8e0cb570ef..50952dd217 100755 --- a/basis/io/unix/sockets/sockets.factor +++ b/basis/io/unix/sockets/sockets.factor @@ -67,7 +67,7 @@ M: object ((client)) ( addrspec -- fd ) M: object (server) ( addrspec -- handle ) [ SOCK_STREAM server-socket-fd - dup handle-fd 10 listen io-error + dup handle-fd 128 listen io-error ] with-destructors ; : do-accept ( server addrspec -- fd sockaddr ) diff --git a/extra/benchmark/sockets/sockets.factor b/extra/benchmark/sockets/sockets.factor index 66c9c11167..68e3a625a7 100755 --- a/extra/benchmark/sockets/sockets.factor +++ b/extra/benchmark/sockets/sockets.factor @@ -6,7 +6,7 @@ IN: benchmark.sockets SYMBOL: counter -: number-of-requests 1 ; +: number-of-requests 1000 ; : server-addr ( -- addr ) "127.0.0.1" 7777 ; @@ -31,12 +31,14 @@ SYMBOL: counter ] ignore-errors ; : simple-client ( -- ) - server-addr ascii [ - CHAR: b write1 flush - number-of-requests - [ CHAR: a dup write1 flush read1 assert= ] times - counter get count-down - ] with-client ; + [ + server-addr ascii [ + CHAR: b write1 flush + number-of-requests + [ CHAR: a dup write1 flush read1 assert= ] times + ] with-client + ] try + counter get count-down ; : stop-server ( -- ) server-addr ascii [ @@ -52,8 +54,13 @@ SYMBOL: counter counter get await stop-server yield yield - ] time ; + ] benchmark . flush ; -: socket-benchmarks ; +: socket-benchmarks ( -- ) + 1 clients + 10 clients + 20 clients + 40 clients + 100 clients ; MAIN: socket-benchmarks