Skip to content

RecvNetMsg

Claude edited this page Oct 27, 2026 · 4 revisions

Blitz3DBlitzPlusBlitzBasic

RecvNetMsg

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, DeleteNetPlayer, HostNetGame, NetMsgData, NetMsgFrom, NetMsgTo, NetMsgType, SendNetMsg

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally