.. _object_UdpSocket: :index:`UdpSocket` ------------------ Description *********** The UdpSocket object UDP (User Datagram Protocol) is a lightweight, unreliable, datagram-oriented, connectionless protocol. It can be used when reliability isn't important. See the :ref:`IpSocket ` documentation for all generic socket-related properties, methods and signals. This object was introduced in InCore 2.3. :**› Inherits**: :ref:`IpSocket ` Overview ******** Properties ++++++++++ .. hlist:: :columns: 3 * :ref:`currentDatagram ` * :ref:`IpSocket.autoConnect ` * :ref:`IpSocket.error ` * :ref:`IpSocket.errorString ` * :ref:`IpSocket.hostname ` * :ref:`IpSocket.keepAlive ` * :ref:`IpSocket.lowDelay ` * :ref:`IpSocket.multicastLoopback ` * :ref:`IpSocket.multicastTtl ` * :ref:`IpSocket.pathMtu ` * :ref:`IpSocket.port ` * :ref:`IpSocket.protocol ` * :ref:`IpSocket.receiveBufferSize ` * :ref:`IpSocket.sendBufferSize ` * :ref:`IpSocket.state ` * :ref:`IpSocket.typeOfService ` * :ref:`IoDevice.append ` * :ref:`IoDevice.atEnd ` * :ref:`IoDevice.autoOpen ` * :ref:`IoDevice.bytesAvailable ` * :ref:`IoDevice.canReadLine ` * :ref:`IoDevice.deviceErrorString ` * :ref:`IoDevice.isOpen ` * :ref:`IoDevice.isWritable ` * :ref:`IoDevice.nameArgument ` * :ref:`IoDevice.pos ` * :ref:`IoDevice.readOnly ` * :ref:`IoDevice.size ` * :ref:`IoDevice.truncate ` * :ref:`IoDevice.unbuffered ` * :ref:`Object.objectId ` * :ref:`Object.parent ` Methods +++++++ .. hlist:: :columns: 3 * :ref:`writeDatagram() ` * :ref:`IpSocket.abort() ` * :ref:`IpSocket.connectToHost() ` * :ref:`IpSocket.disconnectFromHost() ` * :ref:`IoDevice.close() ` * :ref:`IoDevice.flush() ` * :ref:`IoDevice.open() ` * :ref:`IoDevice.peekAll() ` * :ref:`IoDevice.read() ` * :ref:`IoDevice.readAll() ` * :ref:`IoDevice.readLine() ` * :ref:`IoDevice.sync() ` * :ref:`IoDevice.write() ` * :ref:`Object.deserializeProperties() ` * :ref:`Object.fromJson() ` * :ref:`Object.serializeProperties() ` * :ref:`Object.toJson() ` Signals +++++++ .. hlist:: :columns: 1 * :ref:`datagramReceived() ` * :ref:`IpSocket.connected() ` * :ref:`IpSocket.disconnected() ` * :ref:`IpSocket.errorOccurred() ` * :ref:`IoDevice.lineAvailableForRead() ` * :ref:`IoDevice.readyRead() ` * :ref:`Object.completed() ` Enumerations ++++++++++++ .. hlist:: :columns: 1 * :ref:`IpSocket.Error ` * :ref:`IpSocket.Protocol ` * :ref:`IpSocket.State ` Properties ********** .. _property_UdpSocket_currentDatagram: .. _signal_UdpSocket_currentDatagramChanged: .. index:: single: currentDatagram currentDatagram +++++++++++++++ This property holds the UDP datagram which has been received most recently. This property is updated automatically whenever new datagrams are received. Every datagram should therefore be processsed in a handler for the :ref:`datagramReceived() ` or :ref:`currentDatagramChanged() ` signals immediately. :**› Type**: :ref:`UdpDatagram ` :**› Signal**: currentDatagramChanged() :**› Attributes**: Readonly Methods ******* .. _method_UdpSocket_writeDatagram: .. index:: single: writeDatagram writeDatagram(Variant datagram) +++++++++++++++++++++++++++++++ This method sends the datagram ``datagram`` to the host address and port numbers specified in the :ref:`UdpDatagram ` object, using the hop count limits also set there. If the destination address and port numbers are unset, this function will send to the address specified in the :ref:`IpSocket.hostname ` property if the socket is connected. :**› Returns**: Boolean Signals ******* .. _signal_UdpSocket_datagramReceived: .. index:: single: datagramReceived datagramReceived() ++++++++++++++++++ This signal is emitted whenever a new datagram has been received and stored in the :ref:`currentDatagram ` property.