-
Notifications
You must be signed in to change notification settings - Fork 40
UDPNAR
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.
Examples:
Python:
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def NAR_AddInput(input):
sock.sendto((input+'\0').encode(), ("127.0.0.1", 50000))
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>. :|:'