UNIX socket communications using Xojo?

I’ve been chatting with ChatGPT trying to learn more about the “mpv” video player software that is a recommended replacement for the now defunct “omxplayer”. I was able to control the omxplayer with dbus commands, but, the new mpv video player uses a JSON API through a UNIX socket.

ChatGPT says that Xojo’s native TCPSocket isn’t compatible with UNIX sockets. Here’s what ChatGPT offers as a solution:

How to Properly Use UNIX Sockets in Xojo

  • You must use declares to call the underlying POSIX socket API functions (socket(), connect(), send(), recv()) directly.
  • This is advanced and requires handling file descriptors and data buffers manually.

Has anyone here used UNIX sockets communication in Xojo?

As far as I know, TCPSocket uses unix sockets.

If you like it a bit more low level, you can use RAWSocketMBS class in MBS Xojo Network Plugin.

Looks like mpv actually uses Unix domain sockets, which are local to the machine, unlike TCP. This would be the equivalent of Xojo’s IPCSocket but I’m unclear whether they are directly compatible.