gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Connect to Unix domain socket instead of host:port


From: Pinnacle Systems Group
Subject: Re: Connect to Unix domain socket instead of host:port
Date: Thu, 19 Dec 2024 08:58:17 -0500

Greetings ---

It's possible to configure gpsd to use a UNIX domain socket instead of the typical TCP host:port setup.

Depending on your requirements, you can achieve this for either the GNSS receiver connection or the client connection to gpsd.

  1. GNSS Receiver Connection over a UNIX Domain Socket

If your GNSS receiver communicates via a UNIX domain socket, you can specify the device using its path. For example:

gpsd /path/to/socket

This assumes the socket file /path/to/socket is accessible and provides the appropriate GNSS data stream.

  1. Client Connection to gpsd via a UNIX Domain Socket

To allow clients to connect to gpsd through a UNIX domain socket, you can specify the socket path when starting gpsd. Use the -S flag to disable the default TCP listener and instead specify a UNIX socket path with the -F flag:

gpsd -F /path/to/gpsd.sock

In this setup:

Clients (e.g., cgps, custom scripts, etc.) can connect to gpsd using the socket file /path/to/gpsd.sock instead of a TCP port.

Make sure the socket file permissions allow client access.

Example Client

For a client to connect via a UNIX domain socket, tools like gpsmon or cgps should be configured to point to the socket path, e.g.:

cgps -s -F /path/to/gpsd.sock

Additional Notes

  1. If using a UNIX domain socket, ensure that both the gpsd server and the client have the appropriate permissions to access the socket.

  2. This approach is often used to improve security and reduce overhead by avoiding TCP communication.

Riley 



On Wed, Dec 18, 2024, 8:42 PM Gary E. Miller <gem@rellim.com> wrote:
Yo Andreas!

On Wed, 18 Dec 2024 22:58:43 +0100
Andreas B <panden@gmail.com> wrote:

> Is it possible to run gpsd so that one connects to a Unix domain
> socket, instead of host:port?

I can't imagine why not.  Do want gpsd to connect to the GNSS receiver
over a UNIX Domain Socket, or have a client connect to gpsd that way?

Do you have an example receiver or client?

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]