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=FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D}{tr:id=name}{td}h6.index{td}{tr}{tr:id=des}{td}{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_des|text=|trigger=button}{sub-section}{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_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:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_ret|text=|trigger=button}{sub-section}{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_see|text=|trigger=button}{sub-section}{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_see|text=|trigger=button}{sub-section}{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_sam|text=|trigger=button}{sub-section}{sub-section:FD568C00F309028A-5C9216A0-486548D6-BEFA9840-7B6537941A61F95CE99C319D_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=1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2}{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:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_des|text=|trigger=button}{sub-section}{sub-section:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_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:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_ret|text=|trigger=button}{sub-section}{sub-section:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_see|text=|trigger=button}{sub-section}{sub-section:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_see|text=|trigger=button}{sub-section}{sub-section:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_sam|text=|trigger=button}{sub-section}{sub-section:1F95E07A271D9443-C5F646FF-4B254EF6-9DD5A3F1-5A09AC07C9996C8FDB6290B2_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=B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC}{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:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_des|text=|trigger=button}{sub-section}{sub-section:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_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:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_ret|text=|trigger=button}{sub-section}{sub-section:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_see|text=|trigger=button}{sub-section}{sub-section:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_see|text=|trigger=button}{sub-section}{sub-section:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_sam|text=|trigger=button}{sub-section}{sub-section:B07ACE72F264F142-80520053-41274183-82418EA5-2DB8575C8E4D7FF99579DBBC_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=FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50}{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:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_des|text=|trigger=button}{sub-section}{sub-section:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_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:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_ret|text=|trigger=button}{sub-section}{sub-section:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_see|text=|trigger=button}{sub-section}{sub-section:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_see|text=|trigger=button}{sub-section}{sub-section:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_sam|text=|trigger=button}{sub-section}{sub-section:FF1A4B77150DBDAE-CF5F0937-456C446B-B20EB501-102EEF8801399563A82DAF50_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=214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F}{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:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_des|text=|trigger=button}{sub-section}{sub-section:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_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:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_ret|text=|trigger=button}{sub-section}{sub-section:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_see|text=|trigger=button}{sub-section}{sub-section:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_see|text=|trigger=button}{sub-section}{sub-section:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_sam|text=|trigger=button}{sub-section}{sub-section:214135AAF0DAB057-9DB5925B-42DD443B-8EF3A269-2171DD2AF385AEAABC86010F_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=06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E}{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:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_des|text=|trigger=button}{sub-section}{sub-section:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_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:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_ret|text=|trigger=button}{sub-section}{sub-section:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_see|text=|trigger=button}{sub-section}{sub-section:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_see|text=|trigger=button}{sub-section}{sub-section:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_sam|text=|trigger=button}{sub-section}{sub-section:06F74D5208F75DA9-4DB5173E-43FE423C-94D39C5B-263B1121ABC349BDFC3E646E_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=D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26}{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:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_des|text=|trigger=button}{sub-section}{sub-section:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_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:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_ret|text=|trigger=button}{sub-section}{sub-section:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_see|text=|trigger=button}{sub-section}{sub-section:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_see|text=|trigger=button}{sub-section}{sub-section:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_sam|text=|trigger=button}{sub-section}{sub-section:D41DEC23794AD5F0-69FBF3D1-46C04D5F-B810A6CB-7E5A9DE0549BE5035BF10B26_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=9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3}{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:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_des|text=|trigger=button}{sub-section}{sub-section:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_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:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_ret|text=|trigger=button}{sub-section}{sub-section:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_see|text=|trigger=button}{sub-section}{sub-section:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_see|text=|trigger=button}{sub-section}{sub-section:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_sam|text=|trigger=button}{sub-section}{sub-section:9ECC81B9B848FAAD-36A30284-47994E06-A545808B-F1FAE18DC4C2BF6794B3CDB3_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=9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC}{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:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_des|text=|trigger=button}{sub-section}{sub-section:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_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:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_prs|trigger=none}length {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_ret|text=|trigger=button}{sub-section}{sub-section:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_see|text=|trigger=button}{sub-section}{sub-section:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_see|text=|trigger=button}{sub-section}{sub-section:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_sam|text=|trigger=button}{sub-section}{sub-section:9B4CE4AEF4966420-13C6967A-4DBF4C85-AA66A7BD-F55A50D76AA5AD692C1216CC_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=3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4}{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:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_des|text=|trigger=button}{sub-section}{sub-section:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_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:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_prs|trigger=none}number {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_ret|text=|trigger=button}{sub-section}{sub-section:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_see|text=|trigger=button}{sub-section}{sub-section:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_see|text=|trigger=button}{sub-section}{sub-section:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_sam|text=|trigger=button}{sub-section}{sub-section:3CC52140840F7F21-316030ED-43F54C2E-96CD9543-7A2A3C3700A83848AF5BD0A4_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=08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA}{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:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_des|text=|trigger=button}{sub-section}{sub-section:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_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:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_prs|trigger=none}array {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_ret|text=|trigger=button}{sub-section}{sub-section:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_see|text=|trigger=button}{sub-section}{sub-section:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_see|text=|trigger=button}{sub-section}{sub-section:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_sam|text=|trigger=button}{sub-section}{sub-section:08A72CAD5224C63D-D1AF71EB-4A4C4C49-AC73B9A9-4C07DF5F7A675E8D47C375AA_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=83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC}{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:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_des|text=|trigger=button}{sub-section}{sub-section:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_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:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_prs|trigger=none}number {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_ret|text=|trigger=button}{sub-section}{sub-section:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_see|text=|trigger=button}{sub-section}{sub-section:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_see|text=|trigger=button}{sub-section}{sub-section:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_sam|text=|trigger=button}{sub-section}{sub-section:83CB4787E9C043C2-C0263BB7-460B450E-8E03A10E-3E1439407E1BDE23FCCD96CC_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=4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318}{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:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_des|text=|trigger=button}{sub-section}{sub-section:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_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:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_prs|trigger=none}number {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_ret|text=|trigger=button}{sub-section}{sub-section:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_see|text=|trigger=button}{sub-section}{sub-section:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_see|text=|trigger=button}{sub-section}{sub-section:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_sam|text=|trigger=button}{sub-section}{sub-section:4660AD5083C394AF-20E7D476-405648B2-92AE81CD-616EEC56339F550D61373318_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=6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F}{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:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_des|text=|trigger=button}{sub-section}{sub-section:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_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:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_prs|trigger=none}string {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_ret|text=|trigger=button}{sub-section}{sub-section:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_see|text=|trigger=button}{sub-section}{sub-section:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_see|text=|trigger=button}{sub-section}{sub-section:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_sam|text=|trigger=button}{sub-section}{sub-section:6C329E9A12173F1C-3C01F922-4BB047AE-BB9FA35A-A650EC99C7DE6914FA6DE01F_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