Hierarchy

Constructors

  • Parameters

    • Optionaloptions: SockDaemonServerOptions

    Returns DaemonServer

Accessors

  • get connectionTimeout(): number
  • Time in milliseconds before a connection will be disconnected if it does not make any requests. Defaults to 1000 (1 second)

    Returns number

  • get idleTimeout(): number
  • Time in milliseconds before the daemon will close if no requests are received. Defaults to 3_600_000 (1 hour)

    Returns number

  • get logFile(): string
  • Path where daemon logs are written

    Returns string

  • get mtimeFile(): string
  • File containing the numeric mtime of the daemon script, so that it can be restarted on change.

    Returns string

  • get path(): string
  • The folder where this daemon service stores stuff

    Returns string

  • get pidFile(): string
  • File containing the daemon process ID

    Returns string

  • get server(): undefined | Server
  • When listening, the net.Server object

    Returns undefined | Server

  • get socket(): string
  • Path to the socket used by this service

    Returns string

  • get serviceName(): string
  • The name of the service. Must match the value set in the SockDaemonClient class that connects to this service.

    Returns string

Methods

  • Stop listening for requests and close the socket.

    Returns void

  • Check if the supplied object is a MessageBase

    Parameters

    • msg: any

    Returns msg is MessageBase

  • Parameters

    • msg: any

    Returns msg is ServiceRequest

  • Check if a daemon server is already running for this cwd/name, and if so, gracefully exit. Otherwise, start up the server and write process id to the pidFile

    Returns Promise<void>