와 (끝없는) 시스템 호출 서비스를 제공 할 수,이 코드가 있다고 가정? 중단 지점이 없기 때문에 폴링 루프를 어디에 연결할 것인지 잘 모릅니다.이 어떻게 토네이도
class TCPDumpHandler(tornado.web.RequestHandler):
def get(self):
self.write("<form method='post' action='/log'><input type='submit'></form>")
@tornado.web.asynchronous
def post(self):
tcpdump = subprocess.Popen("tcpdump -nli any",
stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
outputfile = tcpdump.stdout
for line in outputfile:
print line,
self.write(line)
self.finish()
는 각 self.write (선) 후 self.flush()를 추가하려고 있나요? – Schildmeijer
http://groups.google.com/group/python-tornado/browse_thread/thread/10a28bd316ee1a7f/941973bc71efa916?show_docid=941973bc71efa916 – Schildmeijer
@schildmeijer 참조 1) 플러시는 하위 프로세스의 파이프가 여전히 스트리밍 중이므로 효과적이지 않습니다. 2) 그것은 내가 여기에 어떤 대답도 얻지 못했기 때문에 그곳에 질문을 올리는 것입니다. –