[Twisted-Python] sending file but LineReceiver doesnt run
adigeaydin at gmail.com
Tue Nov 25 05:41:46 EST 2008
I am trying to send file which is in the client's disk, i am using
LineReceiver in the server side. I am sending and receiving data like login
stuff but when i start to read & send file LineReceiver method doesnt run in
the server side. Sending file code part is below, what can be cause of this?
* i am reading 100 kb parts of file and send it, is it best choice? or
reading file once and send it better?
KB = 1024 * 100
if (KB > file_size) | (KB == file_size):
data = self.file.read(file_size)
self.sended += file_size
data = self.file.read(KB)
file_size -= KB
self.sended += KB
def send_data(self, data):
self.transport.write(data + '\r\n')
Uluslararası Bilgisayar Enstitüsü
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python