Page History
Wiki Markup |
---|
{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{hidden} {sub-section:description|text=}{sub-section}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#index] Returns the current position in the byte array of the packet.{td}{tr}{tbody}{table}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}byte[]{td}{td}[#getByteArray]\() Returns the content of the package into a byte array.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getHost]\() Returns the name of the host that sent the packet.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getLength]\() Returns the length of the packet in bytes.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getPort]\() Returns the port where the packet originated from.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#readByte]\() Reads an 8 bits byte value from the packet, starting from the current index.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#readInt]\() Reads a 32 bits int value from the packet, starting from the current index.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#readShort]\() Reads a 32 bits short value from the packet, starting from the current index.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#readUTF]\(length) Reads a UTF string from the packet, starting from the current index.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#writeByte]\(number) Writes one byte into the packet, at the current index.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#writeBytes]\(array) Writes an array of bytes into the packet, at the current index.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#writeInt]\(number) Writes a 32 bits int into the packet, at the current index.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#writeShort]\(number) Writes a 16 bits short value into the packet, at the current index.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#writeUTF]\(string) Writes an UTF encoded string into the packet, at the current index.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A}{tr:id=name}{td}h6.index{td}{tr}{tr:id=des}{td}{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_des|text=|trigger=button}{sub-section}{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_des|trigger=none|class=sIndent}Returns the current position in the byte array of the packet. The next read/write operation will occur at this position.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_ret|text=|trigger=button}{sub-section}{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_see|text=|trigger=button}{sub-section}{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_see|text=|trigger=button}{sub-section}{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_sam|text=|trigger=button}{sub-section}{sub-section:F309028A075D507D-16A07446-48D64D45-98408BBB-F95CE99C319DCD6B8DC0906A_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894}{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}{tr:id=des}{td}{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_des|text=|trigger=button}{sub-section}{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_des|trigger=none|class=sIndent}Returns the content of the package into a byte array.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_ret|text=|trigger=button}{sub-section}{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_see|text=|trigger=button}{sub-section}{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_see|text=|trigger=button}{sub-section}{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_sam|text=|trigger=button}{sub-section}{sub-section:271D9443E2BD9CE9-46FF2072-4EF64EC9-A3F1BC31-6C8FDB6290B22A126A1EE894_sam|class=sIndent|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) { var bytes = packet.getByteArray(); application.output('received a packet of length: ' + bytes.length); for (var i=0; i<bytes.length; i++) application.output(bytes[i]); } else { application.output('end of communication.'); break; } } {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3}{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}{tr:id=des}{td}{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_des|text=|trigger=button}{sub-section}{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_des|trigger=none|class=sIndent}Returns the name of the host that sent the packet.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_ret|text=|trigger=button}{sub-section}{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_see|text=|trigger=button}{sub-section}{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_see|text=|trigger=button}{sub-section}{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_sam|text=|trigger=button}{sub-section}{sub-section:F264F142E0D6962D-0053D921-41834FC8-8EA5B9FC-7FF99579DBBCCB665F241AD3_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC}{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}{tr:id=des}{td}{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_des|text=|trigger=button}{sub-section}{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_des|trigger=none|class=sIndent}Returns the length of the packet in bytes.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_ret|text=|trigger=button}{sub-section}{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_see|text=|trigger=button}{sub-section}{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_see|text=|trigger=button}{sub-section}{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_sam|text=|trigger=button}{sub-section}{sub-section:150DBDAE24ABC00A-0937A1FD-446B4FCC-B501B4AC-9563A82DAF50BD58BE9739AC_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF}{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}{tr:id=des}{td}{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_des|text=|trigger=button}{sub-section}{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_des|trigger=none|class=sIndent}Returns the port where the packet originated from.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_ret|text=|trigger=button}{sub-section}{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_see|text=|trigger=button}{sub-section}{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_see|text=|trigger=button}{sub-section}{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_sam|text=|trigger=button}{sub-section}{sub-section:F0DAB05758E60DF2-925B3D19-443B4E08-A26981FF-AEAABC86010F3497994348AF_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207}{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}{tr:id=des}{td}{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_des|text=|trigger=button}{sub-section}{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_des|trigger=none|class=sIndent}Reads an 8 bits byte value from the packet, starting from the current index. Advances the index with one position.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_ret|text=|trigger=button}{sub-section}{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_see|text=|trigger=button}{sub-section}{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_see|text=|trigger=button}{sub-section}{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_sam|text=|trigger=button}{sub-section}{sub-section:08F75DA9498156CC-173E302B-423C48A1-9C5B80C2-49BDFC3E646E1A49C8A6C207_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A}{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}{tr:id=des}{td}{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_des|text=|trigger=button}{sub-section}{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_des|trigger=none|class=sIndent}Reads a 32 bits int value from the packet, starting from the current index. Advances the index with 4 positions.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_ret|text=|trigger=button}{sub-section}{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_see|text=|trigger=button}{sub-section}{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_see|text=|trigger=button}{sub-section}{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_sam|text=|trigger=button}{sub-section}{sub-section:794AD5F033920C8B-F3D1EA27-4D5F44BE-A6CBB801-E5035BF10B26D742725A176A_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6}{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}{tr:id=des}{td}{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_des|text=|trigger=button}{sub-section}{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_des|trigger=none|class=sIndent}Reads a 32 bits short value from the packet, starting from the current index. Advances the index with 2 positions.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_ret|text=|trigger=button}{sub-section}{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_see|text=|trigger=button}{sub-section}{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_see|text=|trigger=button}{sub-section}{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_sam|text=|trigger=button}{sub-section}{sub-section:B848FAADB893D94A-0284CDE2-4E064697-808BB9A5-BF6794B3CDB383568775A0C6_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A}{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}{tr:id=des}{td}{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_des|text=|trigger=button}{sub-section}{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_des|trigger=none|class=sIndent}Reads a UTF string from the packet, starting from the current index. If an argument is specified, then it represents the length of the string to read. If no argument is specified, then first a 32 bits int is read from the packet and that will be the length of the string. Advances the index with a number of positions that depends on the length of the read string.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_prs|trigger=none}length {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_ret|text=|trigger=button}{sub-section}{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_see|text=|trigger=button}{sub-section}{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_see|text=|trigger=button}{sub-section}{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_sam|text=|trigger=button}{sub-section}{sub-section:F4966420BA34D4C2-967AD39C-4C854677-A7BDAEA1-AD692C1216CC57EA5E39B07A_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A}{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}{tr:id=des}{td}{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_des|text=|trigger=button}{sub-section}{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_des|trigger=none|class=sIndent}Writes one byte into the packet, at the current index. The index is advanced with one position.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_prs|trigger=none}number {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_ret|text=|trigger=button}{sub-section}{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_see|text=|trigger=button}{sub-section}{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_see|text=|trigger=button}{sub-section}{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_sam|text=|trigger=button}{sub-section}{sub-section:840F7F210BBBCEC6-30ED3F6F-4C2E4418-9543B102-3848AF5BD0A42E1DD3582D6A_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1}{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;}\(array){span}{td}{tr}{tr:id=des}{td}{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_des|text=|trigger=button}{sub-section}{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_des|trigger=none|class=sIndent}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.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_prs|trigger=none}array {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_ret|text=|trigger=button}{sub-section}{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_see|text=|trigger=button}{sub-section}{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_see|text=|trigger=button}{sub-section}{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_sam|text=|trigger=button}{sub-section}{sub-section:5224C63D2BA13EE8-71EB8545-4C494A92-B9A9AA62-5E8D47C375AA170977ADC7F1_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E}{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}{tr:id=des}{td}{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_des|text=|trigger=button}{sub-section}{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_des|trigger=none|class=sIndent}Writes a 32 bits int into the packet, at the current index. The index is advances with 4 positions.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_prs|trigger=none}number {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_ret|text=|trigger=button}{sub-section}{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_see|text=|trigger=button}{sub-section}{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_see|text=|trigger=button}{sub-section}{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_sam|text=|trigger=button}{sub-section}{sub-section:E9C043C2D325E494-3BB7374E-450E4015-A10E9868-DE23FCCD96CC64D3FC58424E_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B}{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}{tr:id=des}{td}{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_des|text=|trigger=button}{sub-section}{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_des|trigger=none|class=sIndent}Writes a 16 bits short value into the packet, at the current index. The index is advances with 2 positions.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_prs|trigger=none}number {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_ret|text=|trigger=button}{sub-section}{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_see|text=|trigger=button}{sub-section}{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_see|text=|trigger=button}{sub-section}{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_sam|text=|trigger=button}{sub-section}{sub-section:83C394AF696BFCC9-D476CFE5-48B2478A-81CD8B63-550D6137331822A5ADDFAA8B_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C}{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}{tr:id=des}{td}{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_des|text=|trigger=button}{sub-section}{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_des|trigger=none|class=sIndent}Writes an UTF 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.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_prs|trigger=none}string {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_ret|text=|trigger=button}{sub-section}{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_see|text=|trigger=button}{sub-section}{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_see|text=|trigger=button}{sub-section}{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_sam|text=|trigger=button}{sub-section}{sub-section:12173F1CD37991D4-F922B274-47AE4DFB-A35AA9A6-6914FA6DE01F6E6E4F27BD3C_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table} |
Overview
Content Tools
Activity