! Copyright (C) 2021 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs calendar combinators
-combinators.extras continuations destructors io
-io.encodings.string io.encodings.utf8 io.files.info io.sockets
-io.streams.string kernel layouts make parser prettyprint
-prettyprint.config sequences splitting system system-info
-threads ;
+continuations destructors io io.encodings.string
+io.encodings.utf8 io.files.info io.sockets io.streams.string
+kernel layouts make parser prettyprint prettyprint.config
+sequences splitting system system-info threads ;
IN: broadcast-server
TUPLE: broadcast-server < disposable
] [
[
receive-socket>> receive
- [ utf8 decode "\n" split parse-lines ] dip
+ [ utf8 decode split-lines parse-lines ] dip
] keep handle-data t
] if
] loop
computer-name "computer-name" ,,
os unparse "os" ,,
os-version "os-version" ,,
- username "username" ,,
+ cpu unparse "cpu" ,,
cell-bits "cell-bits" ,,
- physical-mem "physical-mem" ,,
+ username "username" ,,
+
build "build" ,,
- vm-path "vm-path" ,,
- vm-path file-info size>> "vm-size" ,,
vm-git-id "git-id" ,,
version-info "version-info" ,,
+ vm-path "vm-path" ,,
+ vm-path file-info size>> "vm-size" ,,
+ image-path "image-path" ,,
image-path file-info size>> "image-size" ,,
+
+ cpus "cpus" ,,
+ cpu-mhz "cpu-mhz" ,,
+ physical-mem "physical-mem" ,,
+ vm-path file-system-info
+ [ total-space>> "disk-total-size" ,, ]
+ [ free-space>> "disk-free-size" ,, ] bi
] { } make ;
: send-loop ( broadcast-server -- )
] with-destructors ;
! "192.168.88.255" 7777 start-broadcast-server
-! "USE: math 2 2 + ." over send-broadcast-command
\ No newline at end of file
+! "USE: math 2 2 + ." over send-broadcast-command
+