Class: QgsUdpSocketSensor

class qgis.core.QgsUdpSocketSensor

Bases: QgsIODeviceSensor

A UDP socket sensor class

Added in version 3.32.

QgsUdpSocketSensor(parent: Optional[QObject] = None) Constructor for a UDP socket sensor, bound to the specified parent.

Methods

childEvent

connectNotify

create

Returns a new UDP socket sensor.

customEvent

disconnectNotify

handleConnect

handleDisconnect

hostName

Returns the host name the socket connects to.

initIODevice

Initiates the I/O device.

isSignalConnected

parseData

Parses the data read from the device when available.

port

Returns the port the socket connects to.

readPropertiesFromElement

param element:

receivers

sender

senderSignalIndex

setHostName

Sets the host name the socket connects to.

setPort

Sets the port the socket connects to.

timerEvent

type

rtype:

str

writePropertiesToElement

param element:

childEvent(self, a0: QChildEvent | None)
connectNotify(self, signal: QMetaMethod)
create(parent: QObject | None) QgsUdpSocketSensor | None

Returns a new UDP socket sensor.

The caller takes responsibility for deleting the returned object.

Parameters:

parent (Optional[QObject])

Return type:

Optional[QgsUdpSocketSensor]

customEvent(self, a0: QEvent | None)
disconnectNotify(self, signal: QMetaMethod)
handleConnect(self)
handleDisconnect(self)
hostName(self) str

Returns the host name the socket connects to.

Return type:

str

initIODevice(self, device: QIODevice | None)

Initiates the I/O device.

Note

Takes ownership of the device.

isSignalConnected(self, signal: QMetaMethod) bool
parseData(self)

Parses the data read from the device when available.

port(self) int

Returns the port the socket connects to.

Return type:

int

readPropertiesFromElement(self, element: QDomElement, document: QDomDocument) bool
Parameters:
  • element (QDomElement)

  • document (QDomDocument)

Return type:

bool

receivers(self, signal: PYQT_SIGNAL) int
sender(self) QObject | None
senderSignalIndex(self) int
setHostName(self, hostName: str | None)

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)

Sets the port the socket connects to.

Parameters:

port (int)

timerEvent(self, a0: QTimerEvent | None)
type(self) str
Return type:

str

writePropertiesToElement(self, element: QDomElement, document: QDomDocument) bool
Parameters:
  • element (QDomElement)

  • document (QDomDocument)

Return type:

bool