Skip to content

StreamConnection

The StreamConnection class stores a single connection to a MessageStream along with the buffers used to store the fragments of a message. It is returned by the MessageStream:Subscribe method.

Constructors

StreamConnection new

StreamConnection.new = function(connection: RBXScriptConnection, buffers: {[string]: FragmentBuffer}): StreamConnection

Returns a new StreamConnection object with the given connection and buffers.

Arguments:

  1. RBXScriptConnection connection - The connection to the MessageStream.
  2. {[string]: FragmentBuffer} buffers - The buffers used to store the fragments of a message.

Properties

RBXScriptConnection Connection

The connection to the MessagingService topic.

boolean Connected

Whether the connection is still active.

{[string]: FragmentBuffer} Buffers

The buffers used to store the fragments of a message. A message with a given interaction ID will be stored in the buffer with the same key. A buffer is cleared when the last fragment of a message is received.


Methods

void Disconnect

StreamConnection:Disconnect = function()

Disconnects the connection to the MessagingService topic and disposes of the buffers.