Permalink
Browse files

Create an arc function to send data to a TCP port

  • Loading branch information...
1 parent 7e074d6 commit 402806d47bdc0c43c009c73f54902a2a2237be36 @scotchi committed Nov 12, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 ac.scm
View
9 ac.scm
@@ -1008,6 +1008,15 @@
(let-values (((us them) (tcp-addresses out)))
them))))))))
+; just does a fire-and forget write to a tcp port
+
+(xdef tcp-send (lambda (host port data)
+ (let-values (((in out) (tcp-connect host port)))
+ (fprintf out data)
+ (flush-output out)
+ (close-input-port in)
+ (close-output-port out))))
+
(xdef new-thread thread)
(xdef kill-thread kill-thread)
(xdef break-thread break-thread)

0 comments on commit 402806d

Please sign in to comment.