I'm looking for some information regarding usage of unix domain sockets (or file sockets) via Python. I've googled for ages but I can't find any example.
Can anyone please give me a quick overview?
it isn't that hard, but the documentation on the python page is a bit wired (no explanation of returns types, etc.)
but did you have a look at this page?
I have, but it doesn't relate to file sockets. I don't quite know how am I supposed to work with those, how to create them, how to write to them or how to read from them.
Can you please explain these?
do you need a file socket, or could you get by with a pipe?
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Man, I wrote this post then the network went down at work... and couldn't post it... skipping all the examples I had:
do what the article has *exactly* but change "AF_INET" to "AF_UNIX" - done...
you should really delve into BSD style sockets if you want to do unix-socket based IPC...
also, python is generally portable. Unix domain sockets are not. The article points to using TCP sockets for IPC, which is a good idea with python because *everything* supports TCP sockets