Changeset 48


Ignore:
Timestamp:
06/16/10 13:56:29 (11 years ago)
Author:
sc
Message:

client:

  • Switched to JSON from Pickle for message encodings
  • Fixed but with command line client not respecting custom server host/port settings

configuration.ini:

  • thinkgear server settings added

configuration.py

  • thinkgear server settings added

server:

  • Switched to JSON from Pickle for message encodings

client_thinkgear:

Location:
remote_control
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • remote_control/puzzlebox_brainstorms_client.py

    r31 r48  
    99# For more information please refer to http://www.gnu.org/copyleft/gpl.html 
    1010# 
    11 # Last Update: 2010.02.03 
     11# Last Update: 2010.06.16 
    1212# 
    1313##################################################################### 
    1414 
    1515import os, sys 
    16 import cPickle as pickle 
     16#import cPickle as pickle 
     17import simplejson as json 
    1718 
    1819from twisted.internet import reactor, protocol, defer 
     
    8485        def connectionMade(self): 
    8586                 
    86                 data = pickle.dumps(self.factory.command) 
     87                #data = pickle.dumps(self.factory.command) 
     88                data = json.dumps(self.factory.command) 
    8789                self.transport.write(data) 
    8890                 
     
    118120                 
    119121                try: 
    120                         reply = pickle.loads(self.data_chunk) 
     122                        #reply = pickle.loads(self.data_chunk) 
     123                        reply = json.loads(self.data_chunk) 
    121124                except Exception, e: 
    122125                        if self.DEBUG: 
     
    218221                 
    219222                self.command_parameters = command_parameters 
    220                 self.server_host = SERVER_HOST 
    221                 self.server_port = SERVER_PORT 
     223                self.server_host = server_host 
     224                self.server_port = server_port 
    222225                self.max_connection_attempts = MAX_CONNECTION_ATTEMPTS 
    223226         
  • remote_control/puzzlebox_brainstorms_configuration.ini

    r45 r48  
    1616SERVER_PORT = 8194 
    1717 
     18THINKGEAR_SERVER_HOST = '127.0.0.1' 
     19THINKGEAR_SERVER_PORT = 13854 
     20 
    1821 
    1922##################################################################### 
  • remote_control/puzzlebox_brainstorms_configuration.py

    r45 r48  
    99# For more information please refer to http://www.gnu.org/copyleft/gpl.html 
    1010# 
    11 # Last Update: 2010.06.10 
     11# Last Update: 2010.06.16 
    1212# 
    1313##################################################################### 
     
    6161SERVER_PORT = 8194 
    6262 
     63THINKGEAR_SERVER_HOST = '127.0.0.1' 
     64THINKGEAR_SERVER_PORT = 13854 
     65 
    6366 
    6467##################################################################### 
     
    9194HEALTH_CHECK_CONNECTION_ATTEMPTS = 5 
    9295NO_REPLY_WAIT = 10 # how many seconds before considering a component dead 
     96 
     97 
     98##################################################################### 
     99# ThinkGear Connect configuration 
     100##################################################################### 
     101 
     102THINKGEAR_AUTHORIZATION_REQUEST = { \ 
     103        "appName": "Puzzlebox Brainstorms", \ 
     104        "appKey": "2e285d7bd5565c0ea73e7e265c73f0691d932408" 
     105        } 
    93106 
    94107 
  • remote_control/puzzlebox_brainstorms_server.py

    r43 r48  
    99# For more information please refer to http://www.gnu.org/copyleft/gpl.html 
    1010# 
    11 # Last Update: 2010.06.01 
     11# Last Update: 2010.06.16 
    1212# 
    1313##################################################################### 
    1414 
    1515import os, signal, sys, time 
    16 import cPickle as pickle 
     16#import cPickle as pickle 
     17import simplejson as json 
    1718 
    1819from twisted.internet import reactor, protocol, defer 
     
    131132                 
    132133                try: 
    133                         self.command = pickle.loads(self.data_chunk) 
     134                        #self.command = pickle.loads(self.data_chunk) 
     135                        self.command = json.loads(self.data_chunk) 
    134136                 
    135137                except Exception, e: 
     
    147149        def send_response(self, response): 
    148150                 
    149                 response = pickle.dumps(response) 
     151                #response = pickle.dumps(response) 
     152                response = json.dumps(response) 
    150153                 
    151154                self.transport.write(response) 
Note: See TracChangeset for help on using the changeset viewer.