Class: QgsTcpSocketSensor

A TCP socket sensor class.

Added in version 3.32.

Class Hierarchy

Inheritance diagram of qgis.core.QgsTcpSocketSensor

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 TCP socket sensor.

class qgis.core.QgsTcpSocketSensor[source]

Bases: QgsIODeviceSensor

__init__(parent: QObject | None = None)

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

Parameters:

parent (Optional[QObject] = None)

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

Returns a new TCP socket sensor.

The caller takes responsibility for deleting the returned object.

Parameters:

parent (Optional[QObject])

Return type:

Optional[QgsTcpSocketSensor]

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)