juan_gandhi: (Default)
[personal profile] juan_gandhi
gitweb.factorcode.org/

   1 ! Copyright (C) 2008 Slava Pestov.
   2 ! See http://factorcode.org/license.txt for BSD license.
   3 USING: accessors calendar calendar.format command-line io
   4 io.encodings.ascii io.servers kernel math.parser namespaces
   5 sequences threads ;
   6 IN: time-server
   7 
   8 : handle-time-client ( -- )
   9     now timestamp>rfc822 print ;
  10 
  11 :  ( port -- threaded-server )
  12     ascii 
  13         "time-server" >>name
  14         swap >>insecure
  15         [ handle-time-client ] >>handler ;
  16 
  17 : time-server-main ( -- )
  18     command-line get [ 1234 ] [ first string>number ] if-empty
  19      start-server wait-for-server ;
  20 
  21 MAIN: time-server-main
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

May 2025

S M T W T F S
    1 2 3
456 7 8 9 10
11 121314151617
181920 21 222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 24th, 2025 11:41 pm
Powered by Dreamwidth Studios