class RenderServerFTP(ftpserver.FTPServer, Thread):
'''
classdocs
'''
def __init__(self):
Thread.__init__(self)
self.authorizer = ftpserver.DummyAuthorizer()
try:
self.authorizer.add_user#### BLA BLA
except ValueError,e:
Logger.warn(self.__class__.__name__ + " : Error starting FTP server, creating dir for storing models")
try:
os.makedirs(join(expanduser("~"), ".arhell"))
except OSError,e:
pass
os.makedirs(join(expanduser("~"), ".arhell", "models"))
self.authorizer.add_user# BLA BLA BLA
self.handler = ftpserver.FTPHandler
self.handler.authorizer = self.authorizer
ftpserver.FTPServer.__init__(self, ("0.0.0.0", 15021), self.handler)
def run(self):
self.serve_forever()
=> so it is a thread that doesnt hang. BUT how do I stop the server??? Calling close_all() or close() from a different Thread (3D render server) causes an error:
Shutting down FTP server
Exception in thread Thread-1:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 530, in __bootstrap_inner
self.run()
File "/Volumes/Kosta_Home/homes/kosta/git/kivyarhellgui/network/RenderServerFTP.py", line 39, in run
self.serve_forever()
File "/Library/Python/2.7/site-packages/pyftpdlib/ftpserver.py", line 3751, in serve_forever
poll_fun(timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 140, in poll
r, w, e = select.select(r, w, e, timeout)
error: (9, 'Bad file descriptor')
--
You received this message because you are subscribed to the "Python FTP server library" project group:
http://code.google.com/p/pyftpdlib/
To post to this group, send email to pyft...@googlegroups.com
To unsubscribe from this group, send email to pyftpdlib-...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/pyftpdlib
---
You received this message because you are subscribed to the Google Groups "Python FTP server library - Discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyftpdlib+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.