SocketServer: replace network by hard drive

Thomas Jollans thomas at jollybox.de
Fri Sep 24 13:28:45 EDT 2010


On Friday 24 September 2010, it occurred to antoine to exclaim:
> Hello,
> 
> 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?

If you're using UNIX, and you don't actually need the stream to be passed via 
the hard drive (why would you?), but for some reason want to use the file 
system, look info UNIX/local sockets. But, really, I'm guessing that local TCP 
sockets (our old friend 127.0.0.1/8) will work just as well for whatever 
you're doing (though I may be mistaken), are portable to non-UNIX system, and 
won't be any slower than UNIX domain sockets on most, if not all, systems.



More information about the Python-list mailing list