# number UDPSocket.bind(number port)

with Promise style call: Not supported

Mini Program plugin: Support, need to Mini Program base library version no less than 2.11.1

Bind a system randomly assigned available port or bind a specified port number

# parameter

# number port

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

Specifies the port number to bind, or returns the randomly assigned available port in the system

# Return value

# number

Successfully bound port number

# sample code


  const udp = wx.createUDPSocket()
  const port = udp.bind()