Skip to content

CreateUDPStream

Narta Xaymar Dirks edited this page Nov 1, 2026 · 6 revisions

Blitz3DBlitzPlusBlitzBasic

CreateUDPStream

CreateUDPStream:Int32 port:Int32=0
Parameter Mode Type Default Description
port In Int32 0 The port to receive on. Defaults to 0, which lets the system pick one.

Returns: A UDP stream, or 0 when the port cannot be used.

Description

Creates a UDP stream that can send and receive messages. Use a fixed port when other programs have to find you, and no port to let the system pick one.

Differences

  • The stream receives IPv4 and IPv6 messages (where the system has IPv6), see IPv6.

Examples

a = CreateUDPStream(40752)
b = CreateUDPStream(40753)
UDPTimeouts 1000
WriteInt a, 12345
SendUDPMsg a, $7F000001, 40753
size = RecvUDPMsg(b)
Print size
Print ReadInt(b)
Print UDPMsgPort(b)
CloseUDPStream a
CloseUDPStream b
4
12345
40752

Related Commands

AcceptTCPStream, CloseTCPStream, CloseUDPStream, CreateTCPServer, GetUDPStreamAddress, OpenTCPStream, UDPStreamIP, UDPStreamPort

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally