As far as I know usocket does not provide implementation of Unix domain sockets, nonetheless SBCL[1], CCL[2] and ECL[3] (and maybe other) implement them. After doing some research I see that feature in usocket is desired (see: usocket-devel question[4], another usocket-devel question[5]), even partially implemented[6] by @tmccombs.
I would like to try to implement this feature without breaking the current API. It could be done by assuming that the ``host'' parameter in socket-connect function takes pathname -- indicating we mean the *Unix* kind of socket. In this particular case we will ignore the ``port'' portion(or signal condition when it is not ``nil'').
I am looking for comments and advice.
[1] http://www.sbcl.org/manual/#Local-_0028Unix_0029-Domain-Sockets [2] http://ccl.clozure.com/manual/chapter8.1.html [3] https://gitlab.com/embeddable-common-lisp/ecl/blob/develop/contrib/sockets/s... [4] https://mailman.common-lisp.net/pipermail/usocket-devel/2008-August/000198.h... [5] https://mailman.common-lisp.net/pipermail/usocket-devel/2009-February/000251... [6] https://github.com/usocket/usocket/compare/master...tmccombs:unix-sockets
-- Regards, Marcin Moskal
Hi Marcin,
The main problem is that, no user is asking for this feature and really rare users need it. (P. S. CLX or CLIM could have such needs, because X11 can be communicated through Unix domain sockets)
Besides those links that you gave, before 2010, I myself have also made a LispWorks version of Unix domain socket support as part of my old project “LispWorks-UDP”:
https://sourceforge.net/p/cl-net-snmp/code/HEAD/tree/lispworks-udp/trunk/uni...
So ... if you want to help, using all current available code plus your own, that will be mostly welcome :)
Regards,
Chun Tian (binghe)
Il giorno 16/ago/2016, alle ore 21:02, Marcin Moskal mmos@student.agh.edu.pl ha scritto:
As far as I know usocket does not provide implementation of Unix domain sockets, nonetheless SBCL[1], CCL[2] and ECL[3] (and maybe other) implement them. After doing some research I see that feature in usocket is desired (see: usocket-devel question[4], another usocket-devel question[5]), even partially implemented[6] by @tmccombs.
I would like to try to implement this feature without breaking the current API. It could be done by assuming that the ``host'' parameter in socket-connect function takes pathname -- indicating we mean the *Unix* kind of socket. In this particular case we will ignore the ``port'' portion(or signal condition when it is not ``nil'').
I am looking for comments and advice.
[1] http://www.sbcl.org/manual/#Local-_0028Unix_0029-Domain-Sockets [2] http://ccl.clozure.com/manual/chapter8.1.html [3] https://gitlab.com/embeddable-common-lisp/ecl/blob/develop/contrib/sockets/s... [4] https://mailman.common-lisp.net/pipermail/usocket-devel/2008-August/000198.h... [5] https://mailman.common-lisp.net/pipermail/usocket-devel/2009-February/000251... [6] https://github.com/usocket/usocket/compare/master...tmccombs:unix-sockets
-- Regards, Marcin Moskal
Hey,
Chun Tian (binghe) writes:
Hi Marcin,
The main problem is that, no user is asking for this feature and really rare users need it. (P. S. CLX or CLIM could have such needs, because X11 can be communicated through Unix domain sockets)
Yes, and potential Wayland protocol implementation. I think that the main benefit of implementing Unix domain sockets in usocket is to have a complete socket interface in Common Lisp (ie to not depend on system libraries like libfixposix, what is a case with iolib).
Besides those links that you gave, before 2010, I myself have also made a LispWorks version of Unix domain socket support as part of my old project “LispWorks-UDP”:
https://sourceforge.net/p/cl-net-snmp/code/HEAD/tree/lispworks-udp/trunk/uni...
So ... if you want to help, using all current available code plus your own, that will be mostly welcome :)
Regards,
Chun Tian (binghe)
Best regards, Daniel
Il giorno 16/ago/2016, alle ore 21:02, Marcin Moskal mmos@student.agh.edu.pl ha scritto:
As far as I know usocket does not provide implementation of Unix domain sockets, nonetheless SBCL[1], CCL[2] and ECL[3] (and maybe other) implement them. After doing some research I see that feature in usocket is desired (see: usocket-devel question[4], another usocket-devel question[5]), even partially implemented[6] by @tmccombs.
I would like to try to implement this feature without breaking the current API. It could be done by assuming that the ``host'' parameter in socket-connect function takes pathname -- indicating we mean the *Unix* kind of socket. In this particular case we will ignore the ``port'' portion(or signal condition when it is not ``nil'').
I am looking for comments and advice.
[1] http://www.sbcl.org/manual/#Local-_0028Unix_0029-Domain-Sockets [2] http://ccl.clozure.com/manual/chapter8.1.html [3] https://gitlab.com/embeddable-common-lisp/ecl/blob/develop/contrib/sockets/s... [4] https://mailman.common-lisp.net/pipermail/usocket-devel/2008-August/000198.h... [5] https://mailman.common-lisp.net/pipermail/usocket-devel/2009-February/000251... [6] https://github.com/usocket/usocket/compare/master...tmccombs:unix-sockets
-- Regards, Marcin Moskal
Hey,
Chun Tian (binghe) writes:
Hi Marcin,
The main problem is that, no user is asking for this feature and really rare users need it. (P. S. CLX or CLIM could have such needs, because X11 can be communicated through Unix domain sockets)
Yes, and potential Wayland protocol implementation. I think that the main benefit of implementing Unix domain sockets in usocket is to have a complete socket interface in Common Lisp (ie to not depend on system libraries like libfixposix, what is a case with iolib).
In order to do that, you'll need to use the SCM_RIGHTS and SCM_CREDENTIALS ancillary messages. To access those, you'll need the equivalent of the CMSG_* macros, which are OS/libc dependent. With some gcc -E manual work you should be able to translate those to Lisp, but you need to do it for every ABI you plan to support. See unix(7) and cmsg(3).