Last change
on this file since 19181 was
19181,
checked in by Moritz Heidkamp, 11 years ago
|
vandusen: get rid of regex-case dependency
|
File size:
812 bytes
|
Line | |
---|
1 | (module vandusen-remote () |
---|
2 | |
---|
3 | (import chicken scheme extras srfi-13) |
---|
4 | (require-library regex) |
---|
5 | (import irregex) |
---|
6 | (use vandusen tcp srfi-18) |
---|
7 | |
---|
8 | (plugin 'remote |
---|
9 | (lambda () |
---|
10 | (let ((listener (tcp-listen ($ 'remote-port)))) |
---|
11 | (add-finalizer (lambda () |
---|
12 | (debug "finalizing remote listener") |
---|
13 | (tcp-close listener))) |
---|
14 | |
---|
15 | (thread-start! (lambda () |
---|
16 | (let loop () |
---|
17 | (receive (in out) (tcp-accept listener) |
---|
18 | (thread-start! (lambda () |
---|
19 | (and-let* ((match (irregex-match |
---|
20 | '(seq (submatch (+ (~ space))) |
---|
21 | " " |
---|
22 | (submatch (+ any))) |
---|
23 | (read-line in)))) |
---|
24 | (say (string-trim (irregex-match-substring match 2)) |
---|
25 | (irregex-match-substring match 1))) |
---|
26 | (close-input-port in) |
---|
27 | (close-output-port out))) |
---|
28 | (loop))))))))) |
---|
Note: See
TracBrowser
for help on using the repository browser.