Class: QgsTcpSocketSensor

class qgis.core.QgsTcpSocketSensor

Bases: QgsIODeviceSensor

A TCP socket sensor class

New in version 3.32.

QgsTcpSocketSensor(parent: QObject = None) Constructor for a TCP socket sensor, bound to the specified parent.

Methods

childEvent

connectNotify

create

Returns a new TCP 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, QChildEvent)
connectNotify(self, QMetaMethod)
create(parent: QObject) QgsTcpSocketSensor

Returns a new TCP socket sensor.

The caller takes responsibility for deleting the returned object.

Parameters:

parent (QObject) –

Return type:

QgsTcpSocketSensor

customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
handleConnect(self)
handleDisconnect(self)
hostName(self) str

Returns the host name the socket connects to.

Return type:

str

initIODevice(self, device: QIODevice)

Initiates the I/O device.

Note

Takes ownership of the device.

isSignalConnected(self, 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, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
setHostName(self, hostName: str)

Sets the host name the socket connects to.

Parameters:

hostName (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, QTimerEvent)
type(self) str
Return type:

str

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

  • document (QDomDocument) –

Return type:

bool