Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat's wrong with my twisted server that's supposed to take a .exe and send its stdio to anyone who asks. Instead, it doesn't send anything
    text
    copied!<pre><code>print 'Preall test works!' from twisted.internet import reactor, protocol from twisted.python import log import sys print 'Imports done' class PrgShell(protocol.Protocol): data = '' class PrgProto(protocol.ProcessProtocol): def __init__(self, out): print 'Prgproto instance made' self.transportout = out.transport self.out = out def outReceived(self, data): """Called when process sends data. We send it on to transport, however if it's 'I want input', we need to activate input.""" print 'Sub said: '+data if data == "input": print 'Sub wants input' self.transportout.write("input") sleep(0.01) self.transport(self.out.getWrit()) else: self.transportout.write(data) def getWrit(self): print 'Proto gave input to prg' data = self.data self.data = '' return data def connectionMade(self): global reactor print 'Connected' proto = self.PrgProto(self) addr = "C:\\Documents and Settings\\papa\\My Documents\\Python\\Files\\Maze\\exe\\maze.exe" reactor.spawnProcess(proto, addr) print 'Procces spawned!' def dataReceived(self, data): print 'Data recived: '+data self.data+=data print 'About to do stuff' factory = protocol.ServerFactory() factory.protocol = PrgShell #f = open("errors.txt", 'w') #log.startLogging(f) #print 'Logging started' reactor.listenTCP(8000,factory) print 'Runing' reactor.run() </code></pre> <p>The program in question prints stuff first thing. When I connect to it, via raw sockets, it doesn't send anything. Here's the output:</p> <pre><code>Preall test works! Imports done About to do stuff Runing (connect) Connected Prgproto instance made Procces spawned! </code></pre> <p>Am I missing anything?</p> <p>Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload