bt_comm: changed message format for starting client
authorAdriana Draghici <adriana008@gmail.com>
Fri, 29 Jan 2010 14:46:20 +0000 (16:46 +0200)
committerAdriana Draghici <adriana008@gmail.com>
Fri, 29 Jan 2010 14:46:20 +0000 (16:46 +0200)
Util.py [new file with mode: 0644]
bt_comm/PROTOCOL

diff --git a/Util.py b/Util.py
new file mode 100644 (file)
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
index 24d4dbc..f74613c 100644 (file)
@@ -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