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
Returns a new TCP socket sensor.
Returns the host name the socket connects to.
Initiates the I/O
device
.Parses the data read from the device when available.
Returns the port the socket connects to.
- param element:
Sets the host name the socket connects to.
Sets the
port
the socket connects to.- rtype:
str
- 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:
- 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