From c78bf8efe4e10886e6ce01ce26bf5d34c5e23450 Mon Sep 17 00:00:00 2001 From: David Runge Date: Mon, 3 Feb 2014 14:59:27 +0100 Subject: Changed to UDP port, added time_delta for length --- random241osc.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/random241osc.py b/random241osc.py index 3d95f69..1e06917 100755 --- a/random241osc.py +++ b/random241osc.py @@ -10,20 +10,21 @@ target = None def connect_to_server(hostname, port): global target if (hostname or port) is None: - target = osc.Adress('127.0.0.1', 57120, osc.TCP) + target = osc.Adress('127.0.0.1', 57121, osc.UDP) else: try: - target = osc.Address(hostname, port, osc.TCP) + target = osc.Address(hostname, port, osc.UDP) except osc.AddressError, err: logging.error(err) # Send a osc_message to the server -def send_osc_msg_to_server(randomness): +def send_msg(time_delta, randomness): global target # if the message is not empty and longer than 1 if randomness is not None and len(randomness) > 1: msg = osc.Message("/random") + msg.add(time_delta) msg.add(randomness[0], randomness[1]) try: osc.send(target, msg) -- cgit v1.2.3-70-g09d2