Skip to content

RecvNetMsg

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

RecvNetMsg BlitzBasic

RecvNetMsg:Int32

Returns: 1 when a message was taken, 0 when nothing arrived.

Description

Takes the next message that arrived and makes it available to NetMsgType and the other message commands. Call it in a loop until it returns 0, once per frame, to handle everything that arrived.

Examples

While RecvNetMsg()
	Select NetMsgType()
		Case 100 : Print NetPlayerName$(NetMsgFrom()) + " joined"
		Case 101 : Print NetPlayerName$(NetMsgFrom()) + " left"
		Case 200 : Print "lost the game"
		Default : Print NetMsgData$()
	End Select
Wend

Related Commands

CreateNetPlayer BlitzBasic, DeleteNetPlayer BlitzBasic, HostNetGame BlitzBasic, NetMsgData BlitzBasic, NetMsgFrom BlitzBasic, NetMsgTo BlitzBasic, NetMsgType BlitzBasic, SendNetMsg BlitzBasic

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally