/[cmucl]/src/code/remote.lisp
ViewVC logotype

Diff of /src/code/remote.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9.48.2 by rtoy, Wed Feb 10 02:04:05 2010 UTC revision 1.12 by rtoy, Tue Apr 20 17:57:45 2010 UTC
# Line 1  Line 1 
1    
2  ;;; -*- Log: code.log; Package: wire -*-  ;;; -*- Log: code.log; Package: wire -*-
3  ;;;  ;;;
4  ;;; **********************************************************************  ;;; **********************************************************************
# Line 28  Line 29 
29    finished)    finished)
30    
31  (defvar *pending-returns* nil  (defvar *pending-returns* nil
32    _N"AList of wire . remote-wait structs")    "AList of wire . remote-wait structs")
33    
34    
35  ;;; MAYBE-NUKE-REMOTE-WAIT -- internal  ;;; MAYBE-NUKE-REMOTE-WAIT -- internal
# Line 52  Line 53 
53  ;;; environment of the macro call. No values are returned.  ;;; environment of the macro call. No values are returned.
54  ;;;  ;;;
55  (defmacro remote (wire-form &body forms)  (defmacro remote (wire-form &body forms)
56    _N"Evaluates the given forms remotly. No values are returned, as the remote    "Evaluates the given forms remotly. No values are returned, as the remote
57  evaluation is asyncronus."  evaluation is asyncronus."
58    (let ((wire (gensym)))    (let ((wire (gensym)))
59      `(let ((,wire ,wire-form))      `(let ((,wire ,wire-form))
# Line 72  evaluation is asyncronus." Line 73  evaluation is asyncronus."
73  ;;; return, cause we can kind of guess at what the currect results would be.  ;;; return, cause we can kind of guess at what the currect results would be.
74  ;;;  ;;;
75  (defmacro remote-value-bind (wire-form vars form &rest body)  (defmacro remote-value-bind (wire-form vars form &rest body)
76    _N"Bind VARS to the multiple values of FORM (which is executed remotely). The    "Bind VARS to the multiple values of FORM (which is executed remotely). The
77  forms in BODY are only executed if the remote function returned (as apposed  forms in BODY are only executed if the remote function returned (as apposed
78  to aborting due to a throw)."  to aborting due to a throw)."
79    (cond    (cond
# Line 142  to aborting due to a throw)." Line 143  to aborting due to a throw)."
143  ;;;  ;;;
144  (defmacro remote-value (wire-form form &optional  (defmacro remote-value (wire-form form &optional
145                                    (on-server-unwind                                    (on-server-unwind
146                                     `(error _"Remote server unwound")))                                     `(error (intl:gettext "Remote server unwound"))))
147    _N"Execute the single form remotly. The value of the form is returned.    "Execute the single form remotly. The value of the form is returned.
148    The optional form on-server-unwind is only evaluated if the server unwinds    The optional form on-server-unwind is only evaluated if the server unwinds
149    instead of returning."    instead of returning."
150    (let ((remote (gensym))    (let ((remote (gensym))
# Line 323  to aborting due to a throw)." Line 324  to aborting due to a throw)."
324  ;;; it, call NEW-CONNECTION to do the connecting.  ;;; it, call NEW-CONNECTION to do the connecting.
325  ;;;  ;;;
326  (defun create-request-server (port &optional on-connect &key reuse-address)  (defun create-request-server (port &optional on-connect &key reuse-address)
327    _N"Create a request server on the given port.  Whenever anyone connects to it,    "Create a request server on the given port.  Whenever anyone connects to it,
328     call the given function with the newly created wire and the address of the     call the given function with the newly created wire and the address of the
329     connector.  If the function returns NIL, the connection is destroyed;     connector.  If the function returns NIL, the connection is destroyed;
330     otherwise, it is accepted.  This returns a manifestation of the server that     otherwise, it is accepted.  This returns a manifestation of the server that
# Line 345  to aborting due to a throw)." Line 346  to aborting due to a throw)."
346  ;;; closes the socket behind it.  ;;; closes the socket behind it.
347  ;;;  ;;;
348  (defun destroy-request-server (server)  (defun destroy-request-server (server)
349    _N"Quit accepting connections to the given request server."    "Quit accepting connections to the given request server."
350    (system:remove-fd-handler (request-server-handler server))    (system:remove-fd-handler (request-server-handler server))
351    (ext:close-socket (request-server-socket server))    (ext:close-socket (request-server-socket server))
352    nil)    nil)
# Line 356  to aborting due to a throw)." Line 357  to aborting due to a throw)."
357  ;;; installed to handle return values, etc.  ;;; installed to handle return values, etc.
358  ;;;  ;;;
359  (defun connect-to-remote-server (hostname port &optional on-death)  (defun connect-to-remote-server (hostname port &optional on-death)
360    _N"Connect to a remote request server addressed with the given host and port    "Connect to a remote request server addressed with the given host and port
361     pair.  This returns the created wire."     pair.  This returns the created wire."
362    (let* ((socket (ext:connect-to-inet-socket hostname port))    (let* ((socket (ext:connect-to-inet-socket hostname port))
363           (wire (make-wire socket)))           (wire (make-wire socket)))

Legend:
Removed from v.1.9.48.2  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.5