Threads with Cmd and socket server combination
kaklis at gmail.com
kaklis at gmail.com
Sun May 30 15:07:04 EDT 2010
More information about the Python-list mailing list
Sun May 30 15:07:04 EDT 2010
- Previous message (by thread): Returning value from home made unit - how to?
- Next message (by thread): What's the largest python/django powered website in the world?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
hi,
I have implement a command line app using Python's cmd library module
and it works fine.
I 've also create a simple threaded socket server. How can i merge the
two ones, so that the
console app, is also a listening server? How can i achieve that with
threads?
I'm trying for days and i can't make it work! I know it can be done
with Twisted but i want
to understand how thread works.
The console:
class BM(CmdBase):
"""Simple custom command processor"""
def do_acmd(self):
pass
if __name__ == '__main__':
BM().cmdloop()
and the Server:
class MyClientHandler(SocketServer.BaseRequestHandler):
def handle(self):
pass
server = SocketServer.ThreadingTCPServer(myaddr, MyClientHandler)
server.serve_forever( )
Thanks in advance
Threads can be so difficult
A.K.
- Previous message (by thread): Returning value from home made unit - how to?
- Next message (by thread): What's the largest python/django powered website in the world?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list