Class Index | File Index

Classes


Class rock_datagram_message


Defined in: client.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
rock_datagram_message(recipient_name, recipient_type, message_type, hex)
This class is the basic datagram message object used in communication to/from the serf gateway.
Method Summary
Method Attributes Method Name and Description
 
Read a 32-bit float number from the message, starting from where it last finished reading from.
 
Read an integer (signed) 16-bit number from the message, starting from where it last finished reading from.
 
Read an integer (signed) 32-bit number from the message, starting from where it last finished reading from.
 
Read an integer (signed) 8-bit number from the message, starting from where it last finished reading from.
 
readNumber(size)
Read a number from the message, starting from where it last finished reading from.
 
Read a text string from the message, starting from where it last finished reading from.
 
Read an unsigned 16-bit number from the message, starting from where it last finished reading from.
 
Read an unsigned 32-bit number from the message, starting from where it last finished reading from.
 
Read an unsigned 64-bit number from the message, starting from where it last finished reading from.
 
Read an unsigned 8-bit number from the message, starting from where it last finished reading from.
 
send(poller)
Send this message
 
Set the name of the rock that will receive this message
 
set the type of the rock that will receive this message
 
setType(type)
Set the message type
 
writeF(val)
Write a float 32-bit number to the end of the hex encoded message body
 
writeI16(val)
Write an integer (signed) 16-bit number to the end of the hex encoded message body
 
writeI32(val)
Write an integer (signed) 32-bit number to the end of the hex encoded message body
 
writeI8(val)
Write an integer (signed) 8-bit number to the end of the hex encoded message body
 
writeNumber(val, size)
Write a number to the end of the hex encoded message body
 
writeS(val)
Write a text string to the end of the hex encoded message body
 
writeU16(val)
Write an unsigned 16-bit number to the end of the hex encoded message body
 
writeU32(val)
Write an unsigned 32-bit number to the end of the hex encoded message body
 
writeU64(val)
Write an unsigned 64-bit number to the end of the hex encoded message body
 
writeU8(val)
Write an unsigned 8-bit number to the end of the hex encoded message body
Class Detail
rock_datagram_message(recipient_name, recipient_type, message_type, hex)
This class is the basic datagram message object used in communication to/from the serf gateway.

See also the overview and examples.

Parameters:
{string} recipient_name
the name of the rock which will receive the message
{string} recipient_type
the type ofthe rock. this is only needed if the recipient_name is null. Then the message will be sent to the least loaded rock of the specified type.
{number} message_type
the message type, a rock-specific number for the message type.
{string} hex
the body of the message encoded as hex in a text string
Method Detail
{number} readF()
Read a 32-bit float number from the message, starting from where it last finished reading from.
Returns:
the number

{number} readI16()
Read an integer (signed) 16-bit number from the message, starting from where it last finished reading from.
Returns:
the number

{number} readI32()
Read an integer (signed) 32-bit number from the message, starting from where it last finished reading from.
Returns:
the number

{number} readI8()
Read an integer (signed) 8-bit number from the message, starting from where it last finished reading from.
Returns:
the number

{number} readNumber(size)
Read a number from the message, starting from where it last finished reading from.
Parameters:
{number} size
the number of bits to read.
Returns:
the number

{string} readS()
Read a text string from the message, starting from where it last finished reading from.
Returns:
the text

{number} readU16()
Read an unsigned 16-bit number from the message, starting from where it last finished reading from.
Returns:
the number

{number} readU32()
Read an unsigned 32-bit number from the message, starting from where it last finished reading from.
Returns:
the number

{number} readU64()
Read an unsigned 64-bit number from the message, starting from where it last finished reading from.
Returns:
the number

{number} readU8()
Read an unsigned 8-bit number from the message, starting from where it last finished reading from.
Returns:
the number

send(poller)
Send this message
Parameters:
{server_poller} poller
the poller to send the message via, which will also handle the reply

setRecipientName(name)
Set the name of the rock that will receive this message
Parameters:
{string} name
the recipient rock's name

setRecipientType(type)
set the type of the rock that will receive this message
Parameters:
{string} type
the textual type of the recipient rock

setType(type)
Set the message type
Parameters:
{number} type
the message type (as opposed to recipient rock type)

writeF(val)
Write a float 32-bit number to the end of the hex encoded message body
Parameters:
{number} val
the number to write

writeI16(val)
Write an integer (signed) 16-bit number to the end of the hex encoded message body
Parameters:
{number} val
the number to write

writeI32(val)
Write an integer (signed) 32-bit number to the end of the hex encoded message body
Parameters:
{number} val
the number to write

writeI8(val)
Write an integer (signed) 8-bit number to the end of the hex encoded message body
Parameters:
{number} val
the number to write

writeNumber(val, size)
Write a number to the end of the hex encoded message body
Parameters:
{number} val
the number to write
{number} size
the number of bits to write

writeS(val)
Write a text string to the end of the hex encoded message body
Parameters:
{string} val
the text to write

writeU16(val)
Write an unsigned 16-bit number to the end of the hex encoded message body
Parameters:
{number} val
the number to write

writeU32(val)
Write an unsigned 32-bit number to the end of the hex encoded message body
Parameters:
{number} val
the number to write

writeU64(val)
Write an unsigned 64-bit number to the end of the hex encoded message body
Parameters:
{number} val
the number to write

writeU8(val)
Write an unsigned 8-bit number to the end of the hex encoded message body
Parameters:
{number} val
the number to write

Documentation generated by JsDoc Toolkit 2.3.2 on Sun Nov 29 2009 14:58:50 GMT+0200 (SAST)