Platforms to show: All Mac Windows Linux Cross-Platform

Back to UDPSocketMBS class.

UDPSocketMBS.AddMembership(MultiAddress as string, InterfaceAddress as string = "")

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds this socket to a multicast group.

Internally this uses IPPROTO_IP/IP_ADD_MEMBERSHIP option.
Lasterror is set.

MultiAddress: The IPv4 address of the group to join.
InterfaceAddress: The IPv4 address of the network interface to use. Can be empty for any interface.

Some examples using this method:

UDPSocketMBS.Bind(Port as Integer, IP as string = "")

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Binds the socket to the given port.

If IP is not empty, you can bind the socket to only the given network interface with that IPv4.
Set ReuseAddress to bind to an address which already a socket is bound to.
Lasterror is set.

UDPSocketMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.

UDPSocketMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The destructor.

Closes the socket.

UDPSocketMBS.DropMembership(MultiAddress as string, InterfaceAddress as string = "")

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Removes this socket from a multicast group.

Internally this uses IPPROTO_IP/IP_DROP_MEMBERSHIP option.
Lasterror is set.

MultiAddress: The IPv4 address of the group to join.
InterfaceAddress: The IPv4 address of the network interface to use. Can be empty for any interface.

Some examples using this method:

UDPSocketMBS.Poll

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 18.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Polls for activity.

Calls events if needed.
This is called automatically via timer by the plugin.

UDPSocketMBS.Read(peek as boolean = false) as DatagramMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads a datagram.

If peek is true, the data is not removed from read buffer.
On error returns nil.

UDPSocketMBS.SendMessage(Data as DatagramMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sends a datagram.

Please specify with port and address of datagram where package is sent to.
Returns number of bytes sent.
Lasterror is set.

See also:

UDPSocketMBS.SendMessage(Data as MemoryBlock, IP as String, Port as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sends a datagram.

Please specify with port and IP where package is sent to.
Returns number of bytes sent.
Lasterror is set.

See also:

UDPSocketMBS.SendMessage(Data as string, IP as String, Port as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sends a datagram.

Please specify with port and IP where package is sent to.
Returns number of bytes sent.
Lasterror is set.

See also:

The items on this page are in the following plugins: MBS Network Plugin.


The biggest plugin in space...