[Patches] [Patch #102980] BaseServer class for SocketServer.py (inh. by TCPServer)

noreply@sourceforge.net noreply@sourceforge.net
Fri, 29 Dec 2000 17:22:06 -0800


Patch #102980 has been updated. 

Project: python
Category: library
Status: Open
Submitted by: lkcl
Assigned to : nobody
Summary: BaseServer class for SocketServer.py (inh. by TCPServer)

Follow-Ups:

Date: 2000-Dec-29 17:22
By: lkcl

Comment:
the socketserver code, with a little bit of tweaking, can be made
sufficiently general to service "requests" of any kind, not just by
sockets.  the BaseServer class was created, for example, to poll a table in
a MYSQL database every 2 seconds.  each entry in the table can be allocated
a Handler which deals with the entry.

with this patch, using BaseServer and ThreadedServer classes, the creation
of the server that reads and handles MySQL table entries instead of a
socket was utterly trivial: about 50 lines of python code.

you may consider this code to be utterly useless [why would anyone else
want to do anything like this???] - you are entitled to your opinion.  if
you think so, then think of this: have you considered how to cleanly add
SSL to the TCPSocketServer?  what about using shared memory as the
communications mechanism for a server, instead of sockets?  what about
communication using files?

the SocketServer code is extremely good every useful. it's just that as it
stands, it is tied to sockets, which is not as useful.
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102980&group_id=5470