# UDPSocket.setTTL(number ttl)

Start from base library version 2.18.0. Please remaining backward compatible.

with Promise style call: Not supported

Mini Program plugin: Support

Set up IP_TTL Socket option to set a IP Maximum number of hops allowed for packet transmission

# parameter

# number ttl

ttl Parameters can be 0 reach 255 between

# sample code


  const udp = wx.createUDPSocket()
  udp.onListening(function () {
    udp.setTTL(64)
  })
  udp.bind()