Socket: DataStream

import Quickshell.Io

Unix socket listener.

Properties

Functions

Signals

Property Details

connected: bool

Returns if the socket is currently connected.

Writing to this property will set the target connection state and will not update the property immediately. Setting the property to false will begin disconnecting the socket, and setting it to true will begin connecting the socket if path is not empty.

path: string

The path to connect this socket to when connected is set to true.

Changing this property will have no effect while the connection is active.

Function Details

void flush()

Flush any queued writes to the socket.

void write(data: string)

Write data to the socket. Does nothing if not connected.

Remember to call flush after your last write.

Signal Details

error(error: unknown)

This signal is sent whenever a socket error is encountered.