         tri
     ] with-destructors ;
 
-TUPLE: ssl-handle < disposable file handle connected terminated ;
+TUPLE: ssl-handle < disposable file handle connected ;
 
 SYMBOL: default-secure-context
 

    handle ;

: ssl-error-syscall ( ssl-handle -- event/f )
    f >>connected
    t >>terminated drop
    ERR_get_error {
        { -1 [
            errno { [ ECONNRESET = ] [ EPIPE = ] } 1||


: maybe-handshake ( ssl-handle -- )
    dup connected>> [ drop ] [
        [ [ do-ssl-accept ] with-timeout ]
        [ t swap connected<< ] bi
    ] if ;

! Input ports
