Changeset 11674 in project


Ignore:
Timestamp:
08/18/08 04:40:57 (12 years ago)
Author:
elf
Message:

licence update, tcp-read-timeout clash fix, examples added

Location:
release/3/remote-repl/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • release/3/remote-repl/trunk/LICENCE

    r11657 r11674  
    1 Copyright (C) 2007-2008, Lenny Frank.  All rights reserved.
     1Copyright (C) 2008, Elf.  All rights reserved.
    22
    33Permission is hereby granted, free of charge, to any person obtaining a
  • release/3/remote-repl/trunk/doc.scm

    r11670 r11674  
    1313;;;;             20080817 [elf]  Added history for 1.1.1
    1414;;;;             20080817 [elf]  Added history for 1.1.2
     15;;;;             20080817 [elf]  Examples.
     16;;;;             20080817 [elf]  Added history for 1.1.3
    1517;;;;
    1618
     
    8587            (version "1.1.0" "20080817 [elf]  Numerous small fixes, mostly reported by certainty.")
    8688            (version "1.1.1" "20080817 [elf]  Sleep behaviour correct, compilation warnings cleaned up.")
    87             (version "1.1.2" "20080817 [elf]  Fixed documentation building in egg generation."))
     89            (version "1.1.2" "20080817 [elf]  Fixed documentation building in egg generation.")
     90            (version "1.1.3" "20080817 [elf]  Fixed clash between client and server in same session.  Added examples to documentation.")
     91            )
    8892
    8993        (usage)
     
    413417            (subsection "Bugs"
    414418                (p "None known"))
    415 
     419            (subsection "Examples"
     420                (p "Simplest (default) usage, with tcp connections and no auth:")
     421                (pre "
     422> (require-extension remote-repl-server)
     423; loading chicken/3/remote-repl-server.so ...
     424> (define srv (rrepl-server-start 5555))
     425> (require-extension remote-repl-client)
     426; loading chicken/3/remote-repl-client.so ...
     427> (define cli (rrepl-client-connect \"localhost\" 5555))
     428> (rrepl-client-send cli '(define foo 3))
     429\"#<unspecified>\"
     430> (rrepl-client-send cli 'foo)
     431\"3\"
     432> (rrepl-client-close cli)
     433shutting down session...
     434> (rrepl-server-close srv)
     435\"#t\"
     436")
     437                (p "Using SSL with no authentication and restricting to local connections:")
     438                (pre "
     439> (require-extension openssl)
     440; loading chicken/3/openssl.so ...
     441> (require-extension remote-repl-server)
     442; loading chicken/3/remote-repl-server.so ...
     443> (define srv (rrepl-server-start 5555
     444                                  host: \"localhost\"
     445                                  listen: ssl-listen
     446                                  accept: ssl-accept
     447                                  clisten: ssl-close))
     448> (require-extension remote-repl-client)
     449; loading chicken/3/remote-repl-client.so ...
     450> (define cli (rrepl-client-connect \"localhost\" 5555
     451                                    connect: ssl-connect))
     452> (rrepl-client-send cli '(define foo 3))
     453\"#<unspecified>\"
     454> (rrepl-client-send cli 'foo)
     455\"3\"
     456> (rrepl-client-close cli)
     457shutting down session...
     458> (rrepl-server-close srv)
     459\"#t\"
     460")
     461                (p "Sandboxed evaluation for each session, tcp connections, no authentication:")
     462                (pre "
     463> (require-extension sandbox)
     464; loading chicken/3/sandbox.so ...
     465> (require-extension remote-repl-server)
     466; loading chicken/3/remote-repl-server.so ...
     467> (define srv (rrepl-server-start 5555
     468                                  auth: (lambda (serv sess)
     469                                            (rrepl-session:extra! sess
     470                                                (make-safe-environment
     471                                                    parent: (current-environment)
     472                                                    mutable: #t
     473                                                    extendable: #t))
     474                                            sess)
     475                                  evaler: (lambda (expr sess)
     476                                              (eval expr
     477                                                    (rrepl-session:extra sess)))))
     478> (require-extension remote-repl-client)
     479; loading chicken/3/remote-repl-client.so ...
     480> (define cli (rrepl-client-connect \"localhost\" 5555))
     481> (rrepl-client-send cli '(define foo 3))
     482\"#<unspecified>\"
     483> (rrepl-client-send cli 'foo)
     484\"3\"
     485> (define cli2 (rrepl-client-connect \"localhost\" 5555))
     486> (rrepl-client-send cli2 'foo)
     487\"\\\"condition: (exn) - unbound variable   args: (foo)\\\"\"
     488> (rrepl-client-close cli)
     489shutting down session...
     490> (rrepl-client-close cli2)
     491shutting down session...
     492> (rrepl-server-close srv)
     493\"#t\"
     494")
     495            )
    416496            (subsection "Licence"
    417497                (pre ,(read-all "remote-repl/LICENCE")))
  • release/3/remote-repl/trunk/remote-repl-client.scm

    r11670 r11674  
    1515;;;;             20080817 [elf]  Bumped version to 1.1.1
    1616;;;;             20080817 [elf]  Bumped version to 1.1.2
     17;;;;             20080817 [elf]  Removed timeout due to conflict with server.
     18;;;;                             Fixed output behaviour.
     19;;;;             20080817 [elf]  Bumped version to 1.1.3
    1720;;;;
    1821
     
    5154            auth-default
    5255            close
     56            condition-msg
    5357            rrepl-client-connect
    5458            rrepl-client-send
     
    139143        (rrepl-client:active! cli #f)))
    140144
     145;; (condition-msg CONDITION)
     146;; message component of exception
     147(define condition-msg    (condition-property-accessor 'exn 'message))
     148
    141149
    142150
     
    163171    (##sys#check-string host 'rrepl-client-connect)
    164172    (##sys#check-range port 1 32767 'rrepl-client-connect)
    165     (tcp-read-timeout #f)
    166173    (call-with-values
    167174        (lambda ()
     
    180187    (##sys#check-structure cli 'rrepl-client 'rrepl-client-send)
    181188    (if (rrepl-client:active cli)
    182         (let ((t   #t))
     189        (begin
    183190            (condition-case
    184191                ((rrepl-client:print cli) expr (rrepl-client:outport cli))
     
    187194                        (display "write error - closing\n")))
    188195            (if (rrepl-client:active cli)
    189                 (condition-case
    190                     ((rrepl-client:read cli) (rrepl-client:inport cli))
    191                         (var ()
    192                             ((rrepl-client:close cli) cli)
    193                             (display "read error - closing\n")))))
     196                (let ploop ((t   #t)
     197                            (r   ##sys#undefined-value))
     198                    (condition-case
     199                        (set! r
     200                            ((rrepl-client:read cli) (rrepl-client:inport cli)))
     201                            (var ()
     202                                (if (string=? (condition-msg var)
     203                                              "read operation timed out")
     204                                    (set! t #f)
     205                                    (begin
     206                                        ((rrepl-client:close cli) cli)
     207                                        (display "read error - closing\n")))))
     208                    (if t
     209                        r
     210                        (ploop #t ##sys#undefined-value)))))
    194211        (display "client is not active\n")))
    195212
     
    201218        (begin
    202219            (display (rrepl-client-send cli '(rrepl-session-close)))
     220            (newline)
    203221            ((rrepl-client:close cli) cli))
    204222        #t))
  • release/3/remote-repl/trunk/remote-repl-server.scm

    r11670 r11674  
    2121;;;;             20080817 [elf]  Adjusted thread-quantum for primordial.
    2222;;;;             20080817 [elf]  Bumped version to 1.1.2
     23;;;;             20080817 [elf]  Adjusted thread-quanta.
     24;;;;             20080817 [elf]  Bumped version to 1.1.3
    2325;;;;
    2426
     
    427429           (t   (make-listener-thread s accept auth)))
    428430        (rrepl-server:listen-thr! s t)
    429         (thread-quantum-set! t 1000)
     431        (thread-quantum-set! t (fx+ timeout-accept 4000))
    430432        (thread-start! t)
    431433        s))
  • release/3/remote-repl/trunk/remote-repl.html

    r11670 r11674  
    160160<li>1.1.0 20080817 [elf]  Numerous small fixes, mostly reported by certainty.</li>
    161161<li>1.1.1 20080817 [elf]  Sleep behaviour correct, compilation warnings cleaned up.</li>
    162 <li>1.1.2 20080817 [elf]  Fixed documentation building in egg generation.</li></ul></div>
     162<li>1.1.2 20080817 [elf]  Fixed documentation building in egg generation.</li>
     163<li>1.1.3 20080817 [elf]  Fixed clash between client and server in same session.  Added examples to documentation.</li></ul></div>
    163164<div class="section">
    164165<h3>Usage</h3><tt>(require-extension remote-repl)</tt></div>
     
    399400<p>None known</p></div>
    400401<div class="subsection">
     402<h4>Examples</h4>
     403<p>Simplest (default) usage, with tcp connections and no auth:</p>
     404<pre>
     405&gt; (require-extension remote-repl-server)
     406; loading chicken/3/remote-repl-server.so ...
     407&gt; (define srv (rrepl-server-start 5555))
     408&gt; (require-extension remote-repl-client)
     409; loading chicken/3/remote-repl-client.so ...
     410&gt; (define cli (rrepl-client-connect &quot;localhost&quot; 5555))
     411&gt; (rrepl-client-send cli '(define foo 3))
     412&quot;#&lt;unspecified&gt;&quot;
     413&gt; (rrepl-client-send cli 'foo)
     414&quot;3&quot;
     415&gt; (rrepl-client-close cli)
     416shutting down session...
     417&gt; (rrepl-server-close srv)
     418&quot;#t&quot;
     419</pre>
     420<p>Using SSL with no authentication and restricting to local connections:</p>
     421<pre>
     422&gt; (require-extension openssl)
     423; loading chicken/3/openssl.so ...
     424&gt; (require-extension remote-repl-server)
     425; loading chicken/3/remote-repl-server.so ...
     426&gt; (define srv (rrepl-server-start 5555
     427                                  host: &quot;localhost&quot;
     428                                  listen: ssl-listen
     429                                  accept: ssl-accept
     430                                  clisten: ssl-close))
     431&gt; (require-extension remote-repl-client)
     432; loading chicken/3/remote-repl-client.so ...
     433&gt; (define cli (rrepl-client-connect &quot;localhost&quot; 5555
     434                                    connect: ssl-connect))
     435&gt; (rrepl-client-send cli '(define foo 3))
     436&quot;#&lt;unspecified&gt;&quot;
     437&gt; (rrepl-client-send cli 'foo)
     438&quot;3&quot;
     439&gt; (rrepl-client-close cli)
     440shutting down session...
     441&gt; (rrepl-server-close srv)
     442&quot;#t&quot;
     443</pre>
     444<p>Sandboxed evaluation for each session, tcp connections, no authentication:</p>
     445<pre>
     446&gt; (require-extension sandbox)
     447; loading chicken/3/sandbox.so ...
     448&gt; (require-extension remote-repl-server)
     449; loading chicken/3/remote-repl-server.so ...
     450&gt; (define srv (rrepl-server-start 5555
     451                                  auth: (lambda (serv sess)
     452                                            (rrepl-session:extra! sess
     453                                                (make-safe-environment
     454                                                    parent: (current-environment)
     455                                                    mutable: #t
     456                                                    extendable: #t))
     457                                            sess)
     458                                  evaler: (lambda (expr sess)
     459                                              (eval expr
     460                                                    (rrepl-session:extra sess)))))
     461&gt; (require-extension remote-repl-client)
     462; loading chicken/3/remote-repl-client.so ...
     463&gt; (define cli (rrepl-client-connect &quot;localhost&quot; 5555))
     464&gt; (rrepl-client-send cli '(define foo 3))
     465&quot;#&lt;unspecified&gt;&quot;
     466&gt; (rrepl-client-send cli 'foo)
     467&quot;3&quot;
     468&gt; (define cli2 (rrepl-client-connect &quot;localhost&quot; 5555))
     469&gt; (rrepl-client-send cli2 'foo)
     470&quot;\&quot;condition: (exn) - unbound variable   args: (foo)\&quot;&quot;
     471&gt; (rrepl-client-close cli)
     472shutting down session...
     473&gt; (rrepl-client-close cli2)
     474shutting down session...
     475&gt; (rrepl-server-close srv)
     476&quot;#t&quot;
     477</pre></div>
     478<div class="subsection">
    401479<h4>Licence</h4>
    402 <pre>Copyright (C) 2007-2008, Lenny Frank.  All rights reserved.
     480<pre>Copyright (C) 2008, Elf.  All rights reserved.
    403481
    404482Permission is hereby granted, free of charge, to any person obtaining a
  • release/3/remote-repl/trunk/remote-repl.setup

    r11670 r11674  
    1313;;;;             20080817 [elf]  Bumped version to 1.1.1 (cleanup and sleep).
    1414;;;;             20080817 [elf]  Bumped version to 1.1.2 (documentation fix).
     15;;;;             20080817 [elf]  Bumped version to 1.1.3 (timeout clash, docs).
    1516;;;;
    1617
     
    2223    'remote-repl-server
    2324    '("remote-repl-server.so" "remote-repl-server.exports" "remote-repl.html")
    24     '((version          "1.1.2")
     25    '((version          "1.1.3")
    2526      (documentation    "remote-repl.html")
    2627      (exports          "remote-repl-server.exports")))
     
    3334    'remote-repl-client
    3435    '("remote-repl-client.so" "remote-repl-client.exports" "remote-repl.html")
    35     '((version          "1.1.2")
     36    '((version          "1.1.3")
    3637      (documentation    "remote-repl.html")
    3738      (exports          "remote-repl-client.exports")))
Note: See TracChangeset for help on using the changeset viewer.