Class: QgsUdpSocketSensor

A UDP socket sensor class.

Added in version 3.32.

Class Hierarchy

Inheritance diagram of qgis.core.QgsUdpSocketSensor

Base classes

QgsIODeviceSensor

An abstract class for QIODevice-based sensors.

QgsAbstractSensor

An abstract base class for sensors.

QObject

Methods

hostName

Returns the host name the socket connects to.

port

Returns the port the socket connects to.

setHostName

Sets the host name the socket connects to.

setPort

Sets the port the socket connects to.

Static Methods

create

Returns a new UDP socket sensor.

class qgis.core.QgsUdpSocketSensor[source]

Bases: QgsIODeviceSensor

__init__(parent: QObject | None = None)

Constructor for a UDP socket sensor, bound to the specified parent.

Parameters:

parent (Optional[QObject] = None)

static create(parent: QObject | None) QgsUdpSocketSensor | None[source]

Returns a new UDP socket sensor.

The caller takes responsibility for deleting the returned object.

Parameters:

parent (Optional[QObject])

Return type:

Optional[QgsUdpSocketSensor]

hostName(self) str[source]

Returns the host name the socket connects to.

Return type:

str

port(self) int[source]

Returns the port the socket connects to.

Return type:

int

setHostName(self, hostName: str | None)[source]

Sets the host name the socket connects to.

Parameters:

hostName (Optional[str]) – the host name string (a domain name or an IP address)

setPort(self, port: int)[source]

Sets the port the socket connects to.

Parameters:

port (int)