I would like to create a python server for which the requests are
passed by files on the hard drive instead of a network.
I am currently looking at the SocketServer python module, hoping for
an easy modification.
Is it doable at all?
If yes, how should it be done?
Uhm... First question: how will the server know a client is
"connecting"? Are you monitoring some known directory for the appearance
of a new file (created, in theory, by the client)...
And what will are "request" consist of -- an identifier for the
client process (including perhaps the name of a file to be used for
reply)... Oh, and how do you maintain state if the "connection" requires
multiple request/reply; heck, how do you ensure the file has a complete
request/reply before trying to read it?
Might be possible if the protocol emulates HTTP -- stateless; each
operation is a complete request/reply sequence and then all knowledge is
forgotten (needing a cookie in the request file to identify any needed
prior state).
But for general replacement of network "sockets" I don't see it...
The closest would be Popen() using pipes to communicate -- and just look
at how many problems get posted on trying to do "interactive" processing
with it. Of course, for your server, you need some way to tell the
server that a client wants to connect so both ends can identify a pipe.