Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Hidden
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE


HTML Table
classservoy sReturnTypes
Table Row (tr)
styleheight: 30px;
Table Head (th)
Return Types
Table Row (tr)
Table Cell (td)
Span
classsWordList
JSPacket

HTML Table
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSPacket
Table Cell (td)
#createNewPacket()
Create a new empty packet.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSPacket
Table Cell (td)
#getReceivedPacket()
Get a packet from recieve buffer, read buffer until empty (null is returned).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#sendPacket(ip/host, packet, [port])
Send a packet.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#startSocket(portnumber, methodToInvokeWhenPacketReceivedAndBufferIsEmpty)
Start a UDP socket for a port.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#stopSocket()
Stop the UDP socket for a port.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#testPacket(packet)
Put a test packet in the receive buffer to test your method call and getReceivedPacket.

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idcreateNewPacket
classnode
Table Row (tr)
idname
Table Cell (td)
createNewPacket
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
JSPacket
Span
stylefloat: left; font-weight: bold;
idiets
createNewPacket
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Create a new empty packet.
Table Row (tr)
idret
Table Cell (td)
Returns
JSPacket
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var packet = plugins.udp.createNewPacket()
packet.writeUTF('hello world!')//writes UTF
packet.writeInt(12348293)//writes 4 bytes
packet.writeShort(14823)//writes 2 bytes
packet.writeByte(123)//writes 1 byte
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetReceivedPacket
classnode
Table Row (tr)
idname
Table Cell (td)
getReceivedPacket
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
JSPacket
Span
stylefloat: left; font-weight: bold;
idiets
getReceivedPacket
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Get a packet from recieve buffer, read buffer until empty (null is returned).
Table Row (tr)
idret
Table Cell (td)
Returns
JSPacket
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var packet = null
while( ( packet = plugins.udp.getReceivedPacket() ) != null)
{
	var text = packet.readUTF()
	var count = packet.readInt()
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsendPacket
classnode
Table Row (tr)
idname
Table Cell (td)
sendPacket
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
sendPacket
Span
stylefloat: left;
idiets
(ip/host, packet, [port])
Table Row (tr)
iddes
Table Cell (td)
Send a packet.
Table Row (tr)
idprs
Table Cell (td)
Parameters
ip/host
packet
[port]
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var packet = plugins.udp.createNewPacket()
packet.writeUTF('hello world!')
plugins.udp.sendPacket('10.0.0.1',packet)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstartSocket
classnode
Table Row (tr)
idname
Table Cell (td)
startSocket
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
startSocket
Span
stylefloat: left;
idiets
(portnumber, methodToInvokeWhenPacketReceivedAndBufferIsEmpty)
Table Row (tr)
iddes
Table Cell (td)
Start a UDP socket for a port.
Table Row (tr)
idprs
Table Cell (td)
Parameters
portnumber
methodToInvokeWhenPacketReceivedAndBufferIsEmpty
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
plugins.udp.startSocket(1234,my_packet_process_method)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstopSocket
classnode
Table Row (tr)
idname
Table Cell (td)
stopSocket
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
stopSocket
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Stop the UDP socket for a port.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
plugins.udp.stopSocket()
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idtestPacket
classnode
Table Row (tr)
idname
Table Cell (td)
testPacket
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
testPacket
Span
stylefloat: left;
idiets
(packet)
Table Row (tr)
iddes
Table Cell (td)
Put a test packet in the receive buffer to test your method call and getReceivedPacket.
Table Row (tr)
idprs
Table Cell (td)
Parameters
packet
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var packet = plugins.udp.createNewPacket()
packet.writeUTF('hello world!')
plugins.udp.testPacket(packet)
Table Row (tr)
classlastDetailRow
Table Cell (td)