[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: UNIX domain sockets
From: |
Emanuel Berg |
Subject: |
Re: UNIX domain sockets |
Date: |
Mon, 09 Aug 2021 02:58:40 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
J.P. wrote:
> Someone on Libera asked about this recently, so I thought
> I'd post an example for posterity. This works when using
> socat or similar as a proxy and also with local servers that
> support these sockets (like Ergo).
>
> (defun erc-open-af-unix (name buffer host _port &rest rest)
> (apply #'make-network-process
> `(:name ,name
> :buffer ,buffer
> :service ,host ; sorta makes sense, right?
> :family local
> ,@rest)))
>
> (let ((erc-server-connect-function 'erc-open-af-unix))
> (erc-open "/tmp/my/sock"
> 0
> "tester"
> "Tester"
> 'connect
> "changeme"))
>
> Depending on your Emacs version and what patches you've got
> applied, passing a non-integer port arg to `erc-open' may
> trigger a wrong type error. FYI, this change set [1] allows
> specifying the socket file path as the port (as well as nil
> for both that and the server).
>
> [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48598
Okay, what do you use it for?
--
underground experts united
https://dataswamp.org/~incal