timetags, nested bundles, higher-level API and various tweaks #2
1 changed files with 28 additions and 18 deletions
|
@ -40,34 +40,44 @@
|
|||
(defun port (osc-device)
|
||||
(if (device-active-p osc-device)
|
||||
(multiple-value-bind (addr port)
|
||||
(device-socket-name osc-device)
|
||||
(declare (ignore addr))
|
||||
port)
|
||||
(warn "Device not connected.")))
|
||||
(device-socket-name osc-device)
|
||||
(declare (ignore addr))
|
||||
port)
|
||||
(warn "Device not active.")))
|
||||
|
||||
(defun address (osc-device)
|
||||
(if (device-active-p osc-device)
|
||||
(multiple-value-bind (addr port)
|
||||
(device-socket-name osc-device)
|
||||
(declare (ignore port))
|
||||
addr)
|
||||
(warn "Device not connected.")))
|
||||
(device-socket-name osc-device)
|
||||
(declare (ignore port))
|
||||
addr)
|
||||
(warn "Device not active.")))
|
||||
|
||||
(defun device-socket-peername (osc-device)
|
||||
(socket-peername (socket osc-device)))
|
||||
|
||||
(defun peer-port (osc-device)
|
||||
(if (device-active-p osc-device)
|
||||
(multiple-value-bind (addr port)
|
||||
(device-socket-peername osc-device)
|
||||
(declare (ignore addr))
|
||||
port)
|
||||
(warn "Device not connected.")))
|
||||
(handler-case
|
||||
(multiple-value-bind (addr port)
|
||||
(device-socket-peername osc-device)
|
||||
(declare (ignore addr))
|
||||
port)
|
||||
(sb-bsd-sockets:not-connected-error ()
|
||||
(warn "Device ~a not connected: device removed."
|
||||
(device-socket-name osc-device))
|
||||
(osc-device-cleanup osc-device)))
|
||||
(warn "Device not active.")))
|
||||
|
||||
(defun peer-address (osc-device)
|
||||
(if (device-active-p osc-device)
|
||||
(multiple-value-bind (addr port)
|
||||
(device-socket-peername osc-device)
|
||||
(declare (ignore port))
|
||||
addr)
|
||||
(warn "Device not connected.")))
|
||||
(handler-case
|
||||
(multiple-value-bind (addr port)
|
||||
(device-socket-peername osc-device)
|
||||
(declare (ignore port))
|
||||
addr)
|
||||
(sb-bsd-sockets:not-connected-error ()
|
||||
(warn "Device ~a not connected: device removed."
|
||||
(device-socket-name osc-device))
|
||||
(osc-device-cleanup osc-device)))
|
||||
(warn "Device not active.")))
|
||||
|
|
Loading…
Reference in a new issue