Skip to content
Patrick Hammer edited this page Feb 25, 2020 · 14 revisions

Start the UDPNAR with:

./NAR UDPNAR IP PORT timestep(ns per cycle) printDerivations
./NAR UDPNAR 127.0.0.1 50000 100000 true

Now any client can send Narsese to this instance. Example with nc:

printf '<a --> b>.\0' | nc -u 127.0.0.1 50000

Python:

import socket
ip = "127.0.0.1"
port = 50000
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def NAR_AddInput(input):
    sock.sendto((input+'\0').encode(), (ip, port))

NAR_AddInput("<(*,toothbrush,plastic) --> made_of>. :|:")

Bash:

NAR_AddInput.sh:

printf "$1\0" | nc -w 1 -u 127.0.0.1 50000 &

Example.sh:

sh NAR_AddInput.sh '<(*,toothbrush,plastic) --> made_of>. :|:'
Clone this wiki locally