nserver

nihilistic stats server
Log | Files | Refs | README | LICENSE

README (1046B)


      1 # nserver
      2 
      3 A nihilistic stats server written as part of reading Learn C the Hard
      4 Way.
      5 
      6 It's a toy, bugs galore.
      7 
      8 ## compiling
      9 
     10 You'll need a C compiler (clang or gcc), the [gdbm][1] library and
     11 [GNU make][2].
     12 
     13 [1]: https://www.gnu.org.ua/software/gdbm
     14 [2]: https://www.gnu.org/software/make
     15 
     16 To compile the server, do:
     17 
     18 ```
     19 gmake
     20 ```
     21 
     22 To compile a debuggable version of the server, do:
     23 
     24 ```
     25 gmake dev
     26 ```
     27 
     28 The usual:
     29 
     30 ```
     31 gmake clean
     32 ```
     33 
     34 to clean up things.
     35 
     36 This was written on an OpenBSD machine. There might be issues
     37 compiling this one other systems.
     38 
     39 ## running
     40 
     41 To start this server, do:
     42 
     43 ```
     44 ./bin/nserver
     45 ```
     46 
     47 It'll be listening on port 7899.
     48 
     49 You can connect as a client to the server via `nc`:
     50 
     51 ```
     52 nc 127.0.0.1 7899
     53 ```
     54 
     55 
     56 ### client commands
     57 
     58 Recognized commands:
     59 
     60 
     61 ```
     62 /create NAME
     63 /sample NAME
     64 /mean NAME
     65 /dump NAME
     66 /list
     67 /store NAME
     68 /load NAME ANOTHER_NAME
     69 ```
     70 
     71 The `/store` command stores `NAME` in a persistent database on the disk.
     72 
     73 The `/load` command loads the `NAME` from the persistent database into
     74 memory at ANOTHER_NAME.