Table Head (thead) |
---|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getByteArray |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the content of the package into a byte array. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
|
|
|
|
| application.output('an int is: ' +readInt)moved to indexreceived a packet of length: ' + |
|
|
|
| packetindexapplication.output('a short is: ' + packet.readShort());
for (var i=0; i<bytes.length; i++)
application.output( |
|
|
|
| 'moved to index: ' + packet.index);
bytes[i]);
}
else {
application.output(' |
|
|
|
| abyte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index:of communication.');
break;
}
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the name of the host that sent the packet. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet. |
|
|
|
| index; }
+ ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('message is: ' + packet.readUTF());
}
else {
application.output('end of communication.');
break;
}
} |
|
|
|
|
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\
{table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getByteArray|class=node}{tr:id=name}{td}h6.getByteArray{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}getByteArray{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getByteArray_des|trigger=button|text=}{sub-section}{sub-section:getByteArray_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getByteArray_snc|trigger=button|text=}{sub-section}{sub-section:getByteArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getByteArray_prs|trigger=button|text=}{sub-section}{sub-section:getByteArray_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getByteArray_ret|trigger=button|text=}{sub-section}{sub-section:getByteArray_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getByteArray_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getByteArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getByteArray_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getByteArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getByteArray_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getByteArray_sam|trigger=none}{code:language=javascript}
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the length of the packet in bytes. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('message is: ' + packet.readUTF());
}
else {
application.output('end of communication.');
break;
}
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the port where the packet originated from. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('message is: ' + packet.readUTF());
}
else {
application.output('end of communication.');
break;
}
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Reads an 8 bits byte value from the packet, starting from the current index. Advances the index with one position. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
|
|
|
|
| var bytes = packet.getByteArray()application.output('an int is: ' + packet.readInt());
application.output(' |
|
|
|
| receiveda packet of lengthbyteslengthfor (var i=0; i<bytes.length; i++)
application.output(bytes[i]);
}
else {application.output('a short is: ' + packet.readShort());
application.output('moved to index: ' + packet.index);
application.output(' |
|
|
|
| end of communication.'a byte is: ' + packet.readByte());
|
|
|
|
| break;
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getHost|class=node}{tr:id=name}{td}h6.getHost{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getHost{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getHost_des|trigger=button|text=}{sub-section}{sub-section:getHost_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getHost_snc|trigger=button|text=}{sub-section}{sub-section:getHost_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getHost_prs|trigger=button|text=}{sub-section}{sub-section:getHost_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getHost_ret|trigger=button|text=}{sub-section}{sub-section:getHost_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getHost_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getHost_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getHost_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getHost_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getHost_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getHost_sam|trigger=none}{code:language=javascript}
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
}
else {
application.output('end of communication.');
break;
}
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Reads a 32 bits int value from the packet, starting from the current index. Advances the index with 4 positions. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('an int is: ' + packet.readInt());
application.output('moved to index: ' + packet.index);
application.output('a short is: ' + packet.readShort());
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
}
else {
application.output('end of communication.');
break;
}
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Reads a 32 bits short value from the packet, starting from the current index. Advances the index with 2 positions. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output(' |
|
|
|
| messagereadUTF}
else { application.output('moved to index: ' + packet.index);
application.output( |
|
|
|
| 'end of communication.''a short is: ' + packet.readShort());
|
|
|
|
| breakapplication.output('moved to index: ' + packet.index);
|
|
|
|
| }
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getLength|class=node}{tr:id=name}{td}h6.getLength{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getLength{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getLength_des|trigger=button|text=}{sub-section}{sub-section:getLength_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getLength_snc|trigger=button|text=}{sub-section}{sub-section:getLength_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getLength_prs|trigger=button|text=}{sub-section}{sub-section:getLength_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getLength_ret|trigger=button|text=}{sub-section}{sub-section:getLength_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getLength_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getLength_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getLength_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getLength_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getLength_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getLength_sam|trigger=none}{code:language=javascript}
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
}
else {
application.output('end of communication.');
break;
}
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Reads a UTF-8 string from the packet, starting from the current index. If an argument is specified, then it represents the length (in UTF-8 encoded bytes, not characters) of the string to read. If no argument is specified, then first a 32 bits (4 byte) int is read from the packet and that will be the byte length of the string. Advances the index with a number of positions that depends on the length of the read string. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('message is: ' + packet.readUTF());
}
else {
application.output('end of communication.');
break;
}
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Reads a UTF-8 string from the packet, starting from the current index. If an argument is specified, then it represents the length (in UTF-8 encoded bytes, not characters) of the string to read. If no argument is specified, then first a 32 bits (4 byte) int is read from the packet and that will be the byte length of the string. Advances the index with a number of positions that depends on the length of the read string. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('message is: ' + packet.readUTF());
}
else {
application.output('end of communication.');
break;
}
} |
|
|
|
|
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPort|class=node}{tr:id=name}{td}h6.getPort{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getPort{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getPort_des|trigger=button|text=}{sub-section}{sub-section:getPort_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getPort_snc|trigger=button|text=}{sub-section}{sub-section:getPort_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getPort_prs|trigger=button|text=}{sub-section}{sub-section:getPort_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getPort_ret|trigger=button|text=}{sub-section}{sub-section:getPort_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getPort_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getPort_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getPort_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getPort_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getPort_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getPort_sam|trigger=none}{code:language=javascript}
var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('message is: ' + packet.readUTF());
}
else {
application.output('end of communication.');
break;
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readByte|class=node}{tr:id=name}{td}h6.readByte{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}readByte{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:readByte_des|trigger=button|text=}{sub-section}{sub-section:readByte_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readByte_snc|trigger=button|text=}{sub-section}{sub-section:readByte_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:readByte_prs|trigger=button|text=}{sub-section}{sub-section:readByte_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:readByte_ret|trigger=button|text=}{sub-section}{sub-section:readByte_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readByte_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readByte_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readByte_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readByte_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readByte_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readByte_sam|trigger=none}{code:language=javascript}
var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('an int is: ' + packet.readInt());
application.output('moved to index: ' + packet.index);
application.output('a short is: ' + packet.readShort());
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
}
else {
application.output('end of communication.');
break;
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readInt|class=node}{tr:id=name}{td}h6.readInt{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}readInt{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:readInt_des|trigger=button|text=}{sub-section}{sub-section:readInt_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readInt_snc|trigger=button|text=}{sub-section}{sub-section:readInt_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:readInt_prs|trigger=button|text=}{sub-section}{sub-section:readInt_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:readInt_ret|trigger=button|text=}{sub-section}{sub-section:readInt_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readInt_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readInt_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readInt_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readInt_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readInt_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readInt_sam|trigger=none}{code:language=javascript}
var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('an int is: ' + packet.readInt());
application.output('moved to index: ' + packet.index);
application.output('a short is: ' + packet.readShort());
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
}
else {
application.output('end of communication.');
break;
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readShort|class=node}{tr:id=name}{td}h6.readShort{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}readShort{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:readShort_des|trigger=button|text=}{sub-section}{sub-section:readShort_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readShort_snc|trigger=button|text=}{sub-section}{sub-section:readShort_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:readShort_prs|trigger=button|text=}{sub-section}{sub-section:readShort_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:readShort_ret|trigger=button|text=}{sub-section}{sub-section:readShort_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readShort_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readShort_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readShort_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readShort_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readShort_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readShort_sam|trigger=none}{code:language=javascript}
var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('an int is: ' + packet.readInt());
application.output('moved to index: ' + packet.index);
application.output('a short is: ' + packet.readShort());
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
application.output('a byte is: ' + packet.readByte());
application.output('moved to index: ' + packet.index);
}
else {
application.output('end of communication.');
break;
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readUTF|class=node}{tr:id=name}{td}h6.readUTF{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}readUTF{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:readUTF_des|trigger=button|text=}{sub-section}{sub-section:readUTF_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readUTF_snc|trigger=button|text=}{sub-section}{sub-section:readUTF_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:readUTF_prs|trigger=button|text=}{sub-section}{sub-section:readUTF_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:readUTF_ret|trigger=button|text=}{sub-section}{sub-section:readUTF_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readUTF_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readUTF_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readUTF_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readUTF_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readUTF_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readUTF_sam|trigger=none}{code:language=javascript}
var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('message is: ' + packet.readUTF());
}
else {
application.output('end of communication.');
break;
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readUTF-Number|class=node}{tr:id=name}{td}h6.readUTF{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}readUTF{span}{span:id=iets|style=float: left;}\(length){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:readUTF-Number_des|trigger=button|text=}{sub-section}{sub-section:readUTF-Number_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readUTF-Number_snc|trigger=button|text=}{sub-section}{sub-section:readUTF-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:readUTF-Number_prs|trigger=button|text=}{sub-section}{sub-section:readUTF-Number_prs|trigger=none|class=sIndent}\{[Number]} length
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:readUTF-Number_ret|trigger=button|text=}{sub-section}{sub-section:readUTF-Number_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readUTF-Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readUTF-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readUTF-Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readUTF-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readUTF-Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readUTF-Number_sam|trigger=none}{code:language=javascript}
var packet;
while (packet = plugins.udp.getReceivedPacket()) {
application.output('packet received from ' + packet.getHost() + ':' + packet.getPort());
if (packet.getLength() > 0) {
application.output('message is: ' + packet.readUTF());
}
else {
application.output('end of communication.');
break;
}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=writeByte-Number|class=node}{tr:id=name}{td}h6.writeByte{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}writeByte{span}{span:id=iets|style=float: left;}\(number){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:writeByte-Number_des|trigger=button|text=}{sub-section}{sub-section:writeByte-Number_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:writeByte-Number_snc|trigger=button|text=}{sub-section}{sub-section:writeByte-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:writeByte-Number_prs|trigger=button|text=}{sub-section}{sub-section:writeByte-Number_prs|trigger=none|class=sIndent}\{[Number]} number
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:writeByte-Number_ret|trigger=button|text=}{sub-section}{sub-section:writeByte-Number_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:writeByte-Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeByte-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:writeByte-Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeByte-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:writeByte-Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeByte-Number_sam|trigger=none}{code:language=javascript}
if (!plugins.udp.startSocket('5555', packetReceived)) {
application.output('Failed to start socket.');
} else {
var packet = plugins.udp.createNewPacket();
packet.writeUTF('hello world!');
plugins.udp.sendPacket('localhost', packet, 1234);
packet = plugins.udp.createNewPacket();
packet.writeByte(0xFF);
packet.writeShort(10001);
packet.writeInt(2000000001);
plugins.udp.sendPacket('localhost', packet, 1234);
var imgBytes = plugins.file.readFile('logo.jpg', 1024);
packet = plugins.udp.createNewPacket();
packet.writeBytes(imgBytes);
plugins.udp.sendPacket('localhost', packet, 1234);
plugins.udp.stopSocket();
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=writeBytes-byteArray|class=node}{tr:id=name}{td}h6.writeBytes{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}writeBytes{span}{span:id=iets|style=float: left;}\(bytes){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:writeBytes-byteArray_des|trigger=button|text=}{sub-section}{sub-section:writeBytes-byteArray_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:writeBytes-byteArray_snc|trigger=button|text=}{sub-section}{sub-section:writeBytes-byteArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:writeBytes-byteArray_prs|trigger=button|text=}{sub-section}{sub-section:writeBytes-byteArray_prs|trigger=none|class=sIndent}\{byte[]} bytes
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:writeBytes-byteArray_ret|trigger=button|text=}{sub-section}{sub-section:writeBytes-byteArray_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:writeBytes-byteArray_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeBytes-byteArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:writeBytes-byteArray_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeBytes-byteArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:writeBytes-byteArray_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeBytes-byteArray_sam|trigger=none}{code:language=javascript}
if (!plugins.udp.startSocket('5555', packetReceived)) {
application.output('Failed to start socket.');
} else {
var packet = plugins.udp.createNewPacket();
packet.writeUTF('hello world!');
plugins.udp.sendPacket('localhost', packet, 1234);
packet = plugins.udp.createNewPacket();
packet.writeByte(0xFF);
packet.writeShort(10001);
packet.writeInt(2000000001);
plugins.udp.sendPacket('localhost', packet, 1234);
var imgBytes = plugins.file.readFile('logo.jpg', 1024);
packet = plugins.udp.createNewPacket();
packet.writeBytes(imgBytes);
plugins.udp.sendPacket('localhost', packet, 1234);
plugins.udp.stopSocket();
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=writeInt-Number|class=node}{tr:id=name}{td}h6.writeInt{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}writeInt{span}{span:id=iets|style=float: left;}\(number){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:writeInt-Number_des|trigger=button|text=}{sub-section}{sub-section:writeInt-Number_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:writeInt-Number_snc|trigger=button|text=}{sub-section}{sub-section:writeInt-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:writeInt-Number_prs|trigger=button|text=}{sub-section}{sub-section:writeInt-Number_prs|trigger=none|class=sIndent}\{[Number]} number
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:writeInt-Number_ret|trigger=button|text=}{sub-section}{sub-section:writeInt-Number_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:writeInt-Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeInt-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:writeInt-Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeInt-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:writeInt-Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeInt-Number_sam|trigger=none}{code:language=javascript}
if (!plugins.udp.startSocket('5555', packetReceived)) {
application.output('Failed to start socket.');
} else {
var packet = plugins.udp.createNewPacket();
packet.writeUTF('hello world!');
plugins.udp.sendPacket('localhost', packet, 1234);
packet = plugins.udp.createNewPacket();
packet.writeByte(0xFF);
packet.writeShort(10001);
packet.writeInt(2000000001);
plugins.udp.sendPacket('localhost', packet, 1234);
var imgBytes = plugins.file.readFile('logo.jpg', 1024);
packet = plugins.udp.createNewPacket();
packet.writeBytes(imgBytes);
plugins.udp.sendPacket('localhost', packet, 1234);
plugins.udp.stopSocket();
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=writeShort-Number|class=node}{tr:id=name}{td}h6.writeShort{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}writeShort{span}{span:id=iets|style=float: left;}\(number){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:writeShort-Number_des|trigger=button|text=}{sub-section}{sub-section:writeShort-Number_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:writeShort-Number_snc|trigger=button|text=}{sub-section}{sub-section:writeShort-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:writeShort-Number_prs|trigger=button|text=}{sub-section}{sub-section:writeShort-Number_prs|trigger=none|class=sIndent}\{[Number]} number
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:writeShort-Number_ret|trigger=button|text=}{sub-section}{sub-section:writeShort-Number_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:writeShort-Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeShort-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:writeShort-Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeShort-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:writeShort-Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeShort-Number_sam|trigger=none}{code:language=javascript}
if (!plugins.udp.startSocket('5555', packetReceived)) {
application.output('Failed to start socket.');
} else {
var packet = plugins.udp.createNewPacket();
packet.writeUTF('hello world!');
plugins.udp.sendPacket('localhost', packet, 1234);
packet = plugins.udp.createNewPacket();
packet.writeByte(0xFF);
packet.writeShort(10001);
packet.writeInt(2000000001);
plugins.udp.sendPacket('localhost', packet, 1234);
var imgBytes = plugins.file.readFile('logo.jpg', 1024);
packet = plugins.udp.createNewPacket();
packet.writeBytes(imgBytes);
plugins.udp.sendPacket('localhost', packet, 1234);
plugins.udp.stopSocket();
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=writeUTF-String|class=node}{tr:id=name}{td}h6.writeUTF{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}writeUTF{span}{span:id=iets|style=float: left;}\(string){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:writeUTF-String_des|trigger=button|text=}{sub-section}{sub-section:writeUTF-String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:writeUTF-String_snc|trigger=button|text=}{sub-section}{sub-section:writeUTF-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:writeUTF-String_prs|trigger=button|text=}{sub-section}{sub-section:writeUTF-String_prs|trigger=none|class=sIndent}\{[String]} string
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:writeUTF-String_ret|trigger=button|text=}{sub-section}{sub-section:writeUTF-String_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:writeUTF-String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeUTF-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:writeUTF-String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeUTF-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:writeUTF-String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:writeUTF-String_sam|trigger=none}{code:language=javascript}
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Writes one byte into the packet, at the current index. The index is advanced with one position. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| if (!plugins.udp.startSocket('5555', packetReceived)) {
application.output('Failed to start socket.');
} else {
var packet = plugins.udp.createNewPacket();
packet.writeUTF('hello world!');
plugins.udp.sendPacket('localhost', packet, 1234);
packet = plugins.udp.createNewPacket();
packet.writeByte(0xFF);
packet.writeShort(10001);
packet.writeInt(2000000001);
plugins.udp.sendPacket('localhost', packet, 1234);
var imgBytes = plugins.file.readFile('logo.jpg', 1024);
packet = plugins.udp.createNewPacket();
packet.writeBytes(imgBytes);
plugins.udp.sendPacket('localhost', packet, 1234);
plugins.udp.stopSocket();
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
writeBytes |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Writes an array of bytes into the packet, at the current index. The index is advanced with a number of positions equal to the length of the written array. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| if (!plugins.udp.startSocket('5555', packetReceived)) {
application.output('Failed to start socket.');
} else {
var packet = plugins.udp.createNewPacket();
packet.writeUTF('hello world!');
plugins.udp.sendPacket('localhost', packet, 1234);
packet = plugins.udp.createNewPacket();
packet.writeByte(0xFF);
packet.writeShort(10001);
packet.writeInt(2000000001);
plugins.udp.sendPacket('localhost', packet, 1234);
var imgBytes = plugins.file.readFile('logo.jpg', 1024);
packet = plugins.udp.createNewPacket();
packet.writeBytes(imgBytes);
plugins.udp.sendPacket('localhost', packet, 1234);
plugins.udp.stopSocket();
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Writes a 32 bits int into the packet, at the current index. The index is advances with 4 positions. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| if (!plugins.udp.startSocket('5555', packetReceived)) {
application.output('Failed to start socket.');
} else {
var packet = plugins.udp.createNewPacket();
packet.writeUTF('hello world!');
plugins.udp.sendPacket('localhost', packet, 1234);
packet = plugins.udp.createNewPacket();
packet.writeByte(0xFF);
packet.writeShort(10001);
packet.writeInt(2000000001);
plugins.udp.sendPacket('localhost', packet, 1234);
var imgBytes = plugins.file.readFile('logo.jpg', 1024);
packet = plugins.udp.createNewPacket();
packet.writeBytes(imgBytes);
plugins.udp.sendPacket('localhost', packet, 1234);
plugins.udp.stopSocket();
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
writeShort |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Writes a 16 bits short value into the packet, at the current index. The index is advances with 2 positions. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| if (!plugins.udp.startSocket('5555', packetReceived)) {
application.output('Failed to start socket.');
} else {
var packet = plugins.udp.createNewPacket();
packet.writeUTF('hello world!');
plugins.udp.sendPacket('localhost', packet, 1234);
packet = plugins.udp.createNewPacket();
packet.writeByte(0xFF);
packet.writeShort(10001);
packet.writeInt(2000000001);
plugins.udp.sendPacket('localhost', packet, 1234);
var imgBytes = plugins.file.readFile('logo.jpg', 1024);
packet = plugins.udp.createNewPacket();
packet.writeBytes(imgBytes);
plugins.udp.sendPacket('localhost', packet, 1234);
plugins.udp.stopSocket();
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Writes an UTF-8 encoded string into the packet, at the current index. First the length of the string is written on 4 bytes, then the string is written. The index is advanced with a number of positions equal to the length of the string plus 4. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| if (!plugins.udp.startSocket('5555', packetReceived)) {
application.output('Failed to start socket.');
} else {
var packet = plugins.udp.createNewPacket();
packet.writeUTF('hello world!');
plugins.udp.sendPacket('localhost', packet, 1234);
packet = plugins.udp.createNewPacket();
packet.writeByte(0xFF);
packet.writeShort(10001);
packet.writeInt(2000000001);
plugins.udp.sendPacket('localhost', packet, 1234);
var imgBytes = plugins.file.readFile('logo.jpg', 1024);
packet = plugins.udp.createNewPacket();
packet.writeBytes(imgBytes);
plugins.udp.sendPacket('localhost', packet, 1234);
plugins.udp.stopSocket();
} |
|
|
|
|
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table} |