[Twisted-Python] The opposite function of reactor.listenTCP()

2012-03-30 Thread hz hanks
Hi All, I have a server listen to two ports and run as follows: reactor.listenTCP(PORT1, file_trans_service.getFileTransCtrlServFactory() reactor.listenTCP(PORT2, file_trans_service.getFileTransCtrlServFactory() reactor.run() Now I want to close the function of PORT1, but I

Re: [Twisted-Python] Conflict between Tkinter.mainloop() and twisted.internet.reactor.run()

2012-03-30 Thread hz hanks
The answer is here: http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.tksupport.html use tksupport.install() instead of Tkinter.run() 2012/3/30 hz hanks : > Hi all, > > I'm writing a program with Twisted and use Tkinter to realize the GUI > interface. However, it

[Twisted-Python] Conflict between Tkinter.mainloop() and twisted.internet.reactor.run()

2012-03-30 Thread hz hanks
Hi all, I'm writing a program with Twisted and use Tkinter to realize the GUI interface. However, it seems that I can not run both Tkinter.mainloop() and twisted.internet.reactor.run() in the same thread because they will block the other. I tried to program a button in Tkinter and when the button

[Twisted-Python] Problem with additional connection

2012-03-28 Thread hz hanks
Hi, all I'm writing a client program with Twisted. The client will first connect one server, and based on the data received in the function of dataReceived, the client need to connect other servers. I just tried to call reactor.connectTCP(another_host, another_port, another_factory) one more time

[Twisted-Python] Problem with NAT Traversal

2012-03-26 Thread hz hanks
Hi, All I'm working with a small program to realize P2P file transfer. Therefore, I have to accomplish the function of NAT traversal. From the searching result, I know that it always requires a public server to initialize the transfer, but I don't have one. Now, my idea is that, we already have ma

Re: [Twisted-Python] Limit on transport.write

2012-03-26 Thread hz hanks
Thank you so much for your instant reply. I guess I need much more time to process the information. You are so helpful. Best, Hanks 2012/3/25 Glyph : > > On Mar 26, 2012, at 2:21 AM, hz hanks wrote: > > Hi, all > > I'm writing a program to transfer files over Internet

[Twisted-Python] Limit on transport.write

2012-03-25 Thread hz hanks
Hi, all I'm writing a program to transfer files over Internet. Sometimes the files would be very big. Therefore, I'm not sure whether I could read a large block of data and send them via one time internet.protocol.transport.write(). On the other hand, does the function internet.protocol.transport.

Re: [Twisted-Python] Problem about Multithread

2012-03-17 Thread hz hanks
tamar Turner-Trauring 写道: > On 03/17/2012 09:01 PM, hz hanks wrote: >> Hi, All >> >> I just started Twisted and I've a problem when using it. I want to >> write a program for both the client and the server that the client can >> download something from the server. T

[Twisted-Python] Problem about Multithread

2012-03-17 Thread hz hanks
Hi, All I just started Twisted and I've a problem when using it. I want to write a program for both the client and the server that the client can download something from the server. Therefore, I want every client and server pair can use multithread to download the different parts of the files at t