 : thread-name ( server-name addrspec -- string )
     unparse " connection from " swap 3append ;
 
-: accept-connection ( server -- )
+: accept-connection ( threaded-server -- )
     [ accept ] [ addr>> ] bi
     [ '[ , , , handle-client ] ]
     [ drop threaded-server get name>> swap thread-name ] 2bi
     spawn drop ;
 
-: accept-loop ( server -- )
+: accept-loop ( threaded-server -- )
     [
         threaded-server get semaphore>>
         [ [ accept-connection ] with-semaphore ]

        if*
    ] [ accept-loop ] bi ; inline recursive

: started-accept-loop ( server -- )
    threaded-server get
    [ sockets>> push ] [ ready>> raise-flag ] bi ;



SYMBOL: remote-address

GENERIC: handle-client* ( threaded-server -- )

<PRIVATE

