Multiuser Lingo Dictionary > Multiuser Lingo Dictionary > getNetOutgoingBytes()

 

getNetOutgoingBytes()

Syntax

gMultiuserInstance.getNetOutgoingBytes({userIDString})

Description

Multiuser Server Lingo function; returns the number of bytes currently in the outgoing message buffer, which is data waiting to be sent. This command is useful for determining if all data has been sent or if the client's outgoing buffer has room for large data chunks the user may want to send.

The total number of outgoing bytes possible is set by the maxMessageSize parameter of the setNetBufferLimits command. The default value of maxMessageSize is 16K.

The optional userIDString parameter is used to specify a particular user's buffer when hosting peer connections.

Example

The following code determines how much data is currently in the buffer for the current movie and sends a new message containing a large chunk of data (such as a cast member image) only if there is less than 500K in the buffer. The statements allow for sending pictures of up to 100K:

gMultiuserInstance.setNetBufferLimits(16 * 1024, 600 * 1024, 100)
totalWaiting = gMultiuserInstance.getNetOutgoingBytes
if totalWaiting < (500 * 1024) then
	gMultiuserInstance.sendNetMessage("@AllUsers", "New image", \
	member("Latest snapshot").picture)
end if

See also

sendNetMessage(), setNetBufferLimits