Re: How to set up a 'listening' Unix domain socket

2021-03-22 Thread Robert Latest via Python-list
> Chris Angelico wrote: [Helpful stuff] I'm actually trying to implement a SocketHandler for a Python logger. However, I can't get my handler on the client side to send anything. Do I need to subclass logging.SocketHandler and fill the various methods with meaning? The documentation doesn't say s

Re: How to set up a 'listening' Unix domain socket

2021-03-22 Thread Robert Latest via Python-list
Chris Angelico wrote: > > Hmm, your formatting's messed up, but the code looks fine to me. (Be aware > that you seem to have a "selr" where it should be "self".) Didn't catch that because my program didn't even get to that point ;-) > >> However, when I try to send somthing to that socket, I get

Re: How to set up a 'listening' Unix domain socket

2021-03-22 Thread Chris Angelico
On Mon, Mar 22, 2021 at 9:11 PM Robert Latest via Python-list wrote: > > Hello, > > I'm trying to set up a server that receives data on a Unix domain socket using > the code below. > > import os from socketserver import UnixStreamServer, StreamRequestHandler > > SOCKET = '/tmp/test.socket' > > cla

How to set up a 'listening' Unix domain socket

2021-03-22 Thread Robert Latest via Python-list
Hello, I'm trying to set up a server that receives data on a Unix domain socket using the code below. import os from socketserver import UnixStreamServer, StreamRequestHandler SOCKET = '/tmp/test.socket' class Handler(StreamRequestHandler): def handle(self): data = selr.rfile.read() print(