From c5494ee5a601a39731e2b6015523fc3e37375401 Mon Sep 17 00:00:00 2001 From: Adriana Draghici Date: Fri, 29 Jan 2010 16:46:20 +0200 Subject: [PATCH] bt_comm: changed message format for starting client --- Util.py | 27 +++++++++++++++++++++++++++ bt_comm/PROTOCOL | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 Util.py diff --git a/Util.py b/Util.py new file mode 100644 index 0000000..7b41ae7 --- /dev/null +++ b/Util.py @@ -0,0 +1,27 @@ + +#!/usr/bin/env python + +""" Message types: client -> server """ + +START_MSG = "1"; +STOP_MSG = "2"; +STATUS_MSG = "3"; + +ACK_MSG = "ACK" # send by server to the client after receiving a message if everything was ok +ERROR_MSG = "ERROR " # send by server to the client if the parameters were incorrect + # or the client could not be started etc + +#xml tags from swarm.xml +CLIENT = "client" +BASE_DIR = "base" +UP_LIMIT = "upload_limit" +DL_LIMIT = "download_limit" +DL_DIR = "download_dir" +LOG_DIR = "logging_dir" +OUT_FILE = "output_file" +PORT = "port" + + +#clients +TRIBLER = tribler +TRANSMISSION = transmission diff --git a/bt_comm/PROTOCOL b/bt_comm/PROTOCOL index 24d4dbc..f74613c 100644 --- a/bt_comm/PROTOCOL +++ b/bt_comm/PROTOCOL @@ -32,7 +32,7 @@ Comunicare Client <-> Server - msg 2: dictionar cu parametrii exp: {CLIENT:"tribler", BASE_DIR: "/home/p2p/p2p-clients/tribler/", UP_LIMIT: "512", DL_LIMIT:"256", PORT:"9999", - DL_DIR:"/this/dir", LOG_DIR:"/this/dir"} + DL_DIR:"/this/dir", LOG_DIR:"/this/dir", OUT_FILE: "output_file"} - dupa fiecare msg 1,2 Serverul trimite un mesaj care indica daca a aparut sau nu vreo eroare 3. Mesaje STOP -- 2.20.1