Archive

Posts Tagged ‘python’

SocketServer fail.

August 25, 2008 raptros-v76 Leave a comment

Technically, I should have known better. I thought I had a plan to solve the problem I described earlier.
My idea was towards the end of using python’s SocketServer to create a queue based control provider; i.e, people could connect to the server, and would enter a queue for getting 60 seconds of control over the missile launcher. My plan was to give hand the TCPSocketServer initializer a method that when called, would return a special request handler object that had been either put into a queue or given control; this request handler would then be controllable from the control object that stored it. That way, I would be able give the handler control of the missiles after going through the queue.
The fail came when I discovered that the constructor of a socket server request handler calls all of its processing functions inside itself: the job of running the request finishes when the initializer finishes.
I plan to change my subclassed request handler so that it does not do the job of running the request, instead, the control object will do that job, so that I can thread the handle calls. Oh well.

Argh.

August 22, 2008 raptros-v76 Leave a comment

Ok. Background: I am an intern at radical media. It is a fun internship, I have learned flash programming and broke an enormous mirror. Anyway, I am working on a project to control a USB missile launcher.
Here is the structure:
Linux system running inside parallels on a mac, called missile-launcher
missile-launcher runs my modifications of this program. My modifications change the way the network portion work to use a tcp system. This program is missile.py.
On another server, missilecommand, there is MissileControl.swf, which is a flash program that talks to missile.py on missile-launcher. MissileControl works nicely, however, next week, I am going to make it have a lock system, so only one person at a time will be able to control it. I still have to think about how to do this though.
I’ve also been tasked with writing an iPhone app to control this thing. I tried to do it as a web app, but javascript doesn’t do sockets, afaik. Oh well. I am going to have to learn objective-C.
Anyway, I was trying to use a python program called orbited to make a javascript socket proxy, but it doesn’t seem to work. Maybe I am not doing it right, maybe it doesn’t work the way I need it too. Now I have a headache from this.