Click or drag to resize

PacketPeerUDPListen Method

Makes this PacketPeerUDP listen on the port binding to bind_address with a buffer size recv_buf_size.

If bind_address is set to "*" (default), the peer will listen on all available addresses (both IPv4 and IPv6).

If bind_address is set to "0.0.0.0" (for IPv4) or "::" (for IPv6), the peer will listen on all available addresses matching that IP type.

If bind_address is set to any valid address (e.g. "192.168.1.101", "::1", etc), the peer will only listen on the interface with that addresses (or fail if no interface with the given address exists).

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public Error Listen(
	int port,
	string bindAddress = "*",
	int recvBufSize = 65536
)

Parameters

port
Type: SystemInt32

[Missing <param name="port"/> documentation for "M:Godot.PacketPeerUDP.Listen(System.Int32,System.String,System.Int32)"]

bindAddress (Optional)
Type: SystemString

[Missing <param name="bindAddress"/> documentation for "M:Godot.PacketPeerUDP.Listen(System.Int32,System.String,System.Int32)"]

recvBufSize (Optional)
Type: SystemInt32

[Missing <param name="recvBufSize"/> documentation for "M:Godot.PacketPeerUDP.Listen(System.Int32,System.String,System.Int32)"]

Return Value

Type: Error

[Missing <returns> documentation for "M:Godot.PacketPeerUDP.Listen(System.Int32,System.String,System.Int32)"]

See Also