Remote events queue for the client, is this expected?

Hi folks! My understanding of remote events was that if the client was not connected when the server fired, then it would not receive it. However, by chance I’ve discovered that it seems to still register even with a 5 second delay between server-send and client-connect! See code.

-- SERVER SIDE
-- wait for player, then ping
repeat wait(1) until #game.Players:GetChildren()>0
wait(1)
game.ReplicatedStorage.Test:FireAllClients()
print("SERVER: ping...")
-- CLIENT SIDE
-- don't connect until well after the server has pinged
wait(5)
print"CLIENT: done waiting, connecting..."
game.ReplicatedStorage.Test.OnClientEvent:Connect(function(data)
	print("CLIENT: got ping!")
end)

Now I fully expected this to not register on the client, but the output log tells a different story…

Is this expected behavior? The datasheet for Remote Events has no indication of this (that I can see!). Let me know!

2 Likes

Temporary workaround I’ve come up with…

-- LOCAL CONNECT
local flushtau=tick()
game.ReplicatedStorage.Test.OnClientEvent:Connect(function()
    if tick()-flushtau<0.25 then return end
    ....
end)

Basically, anything in the immediate pipeline is ignored.

I wonder if it is operating in a similar way to MQ (Message Queue) does. It knows there is a Player connected, so it fires the message, which is then sat waiting in Remote Event queue, awaiting collection form the client.