Skip to content

Commit

Permalink
io.servers: Fix a regression where we couldn't listen on several port…
Browse files Browse the repository at this point in the history
…s at once.
  • Loading branch information
erg committed May 23, 2016
1 parent 88fa8b6 commit e19df70
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions basis/io/servers/servers-tests.factor
@@ -1,6 +1,6 @@
USING: accessors calendar concurrency.promises fry io
io.encodings.ascii io.servers
io.servers.private io.sockets kernel namespaces
USING: accessors arrays calendar concurrency.promises fry io
io.encodings.ascii io.encodings.utf8 io.servers
io.servers.private io.sockets kernel namespaces scratchpad
sequences threads tools.test ;
IN: io.servers

Expand Down Expand Up @@ -53,3 +53,20 @@ ipv6-supported? [
[ inet6? ] any?
] unit-test
] unless


! Test that we can listen on several ports at once.
TUPLE: my-threaded-server < threaded-server ;

{ } [
utf8 my-threaded-server new-threaded-server
"127.0.0.1" 0 <inet4>
"127.0.0.1" 0 <inet4>
2array >>insecure

"127.0.0.1" 0 <inet4>
"127.0.0.1" 0 <inet4>
2array >>secure

start-server stop-server
] unit-test
2 changes: 1 addition & 1 deletion basis/io/servers/servers.factor
Expand Up @@ -77,7 +77,7 @@ M: inet6 >insecure 1array ;
M: local >insecure 1array ;
M: integer >insecure internet-server 1array ;
M: string >insecure internet-server 1array ;
M: array >insecure [ >insecure ] map ;
M: array >insecure [ >insecure ] map concat ;
M: f >insecure ;

: >secure ( addrspec -- addrspec' )
Expand Down

0 comments on commit e19df70

Please sign in to comment.