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=62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4}{tr:id=name}{td}h6.index{td}{tr}{tr:id=des}{td}{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_des|text=|trigger=button}{sub-section}{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_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:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_ret|text=|trigger=button}{sub-section}{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_see|text=|trigger=button}{sub-section}{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_see|text=|trigger=button}{sub-section}{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_sam|text=|trigger=button}{sub-section}{sub-section:62A4A6C6BC375F8F-494B7757-46274FFA-AA219578-E2D2FB321BFE424905B158C4_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=196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3}{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:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_des|text=|trigger=button}{sub-section}{sub-section:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_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:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_ret|text=|trigger=button}{sub-section}{sub-section:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_see|text=|trigger=button}{sub-section}{sub-section:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_see|text=|trigger=button}{sub-section}{sub-section:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_sam|text=|trigger=button}{sub-section}{sub-section:196371264DD01240-67B045BC-4E4C4493-83E59A83-EEDC45023A8EDB5B02C41AF3_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=BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59}{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:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_des|text=|trigger=button}{sub-section}{sub-section:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_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:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_ret|text=|trigger=button}{sub-section}{sub-section:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_see|text=|trigger=button}{sub-section}{sub-section:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_see|text=|trigger=button}{sub-section}{sub-section:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_sam|text=|trigger=button}{sub-section}{sub-section:BA5F23CB893AD885-7B47D2E2-49394C16-9834BC6A-CAB97F0C88298328148C8B59_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=5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F}{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:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_des|text=|trigger=button}{sub-section}{sub-section:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_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:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_ret|text=|trigger=button}{sub-section}{sub-section:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_see|text=|trigger=button}{sub-section}{sub-section:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_see|text=|trigger=button}{sub-section}{sub-section:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_sam|text=|trigger=button}{sub-section}{sub-section:5515C59FEB3F3D09-F6EDE2BE-4CFF4989-85CB8EE3-AF8227C9CDE5821B9A50D93F_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=4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83}{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:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_des|text=|trigger=button}{sub-section}{sub-section:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_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:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_ret|text=|trigger=button}{sub-section}{sub-section:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_see|text=|trigger=button}{sub-section}{sub-section:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_see|text=|trigger=button}{sub-section}{sub-section:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_sam|text=|trigger=button}{sub-section}{sub-section:4620B69DC638FF7E-BEC74405-42DD4226-AA83AC9C-37654E3E0BBD24BDDF3DCC83_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=D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377}{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:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_des|text=|trigger=button}{sub-section}{sub-section:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_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:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_ret|text=|trigger=button}{sub-section}{sub-section:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_see|text=|trigger=button}{sub-section}{sub-section:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_see|text=|trigger=button}{sub-section}{sub-section:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_sam|text=|trigger=button}{sub-section}{sub-section:D2B53E7FFF1D9DFD-F101638E-48574C62-A696B8B6-042875E762D3BE6875F92377_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=D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C}{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:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_des|text=|trigger=button}{sub-section}{sub-section:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_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:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_ret|text=|trigger=button}{sub-section}{sub-section:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_see|text=|trigger=button}{sub-section}{sub-section:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_see|text=|trigger=button}{sub-section}{sub-section:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_sam|text=|trigger=button}{sub-section}{sub-section:D75C976125975F82-287C0D7F-4D424718-945EBB58-3DBE40A6F9A5026D2886EA0C_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=C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5}{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:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_des|text=|trigger=button}{sub-section}{sub-section:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_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:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_ret|text=|trigger=button}{sub-section}{sub-section:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_see|text=|trigger=button}{sub-section}{sub-section:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_see|text=|trigger=button}{sub-section}{sub-section:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_sam|text=|trigger=button}{sub-section}{sub-section:C6EDCA20F0C7F3C5-986A97D2-4DD94BCE-9D669C33-9A6168C56029418FAE3C5AE5_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=720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33}{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:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_des|text=|trigger=button}{sub-section}{sub-section:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_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:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_prs|trigger=none}length {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_ret|text=|trigger=button}{sub-section}{sub-section:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_see|text=|trigger=button}{sub-section}{sub-section:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_see|text=|trigger=button}{sub-section}{sub-section:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_sam|text=|trigger=button}{sub-section}{sub-section:720CF9FC94689599-310FBC6E-47304F7A-8EB5849D-5CFC98F3C09F49CFD1074B33_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=5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5}{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:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_des|text=|trigger=button}{sub-section}{sub-section:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_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:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_prs|trigger=none}number {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_ret|text=|trigger=button}{sub-section}{sub-section:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_see|text=|trigger=button}{sub-section}{sub-section:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_see|text=|trigger=button}{sub-section}{sub-section:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_sam|text=|trigger=button}{sub-section}{sub-section:5BF9B1213AED5623-3B9350D2-46AD469A-AD62B752-5A7A53054F58E4D037B4C5F5_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=131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E}{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:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_des|text=|trigger=button}{sub-section}{sub-section:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_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:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_prs|trigger=none}array {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_ret|text=|trigger=button}{sub-section}{sub-section:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_see|text=|trigger=button}{sub-section}{sub-section:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_see|text=|trigger=button}{sub-section}{sub-section:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_sam|text=|trigger=button}{sub-section}{sub-section:131571292DCC8535-224431CF-43F4487D-88CEB8F8-97002541264FC85F409A762E_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=52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974}{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:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_des|text=|trigger=button}{sub-section}{sub-section:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_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:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_prs|trigger=none}number {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_ret|text=|trigger=button}{sub-section}{sub-section:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_see|text=|trigger=button}{sub-section}{sub-section:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_see|text=|trigger=button}{sub-section}{sub-section:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_sam|text=|trigger=button}{sub-section}{sub-section:52D0435410A14CB7-44489C73-489B4D70-877B9FDB-02F87820B551F4AD97D1F974_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=AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31}{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:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_des|text=|trigger=button}{sub-section}{sub-section:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_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:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_prs|trigger=none}number {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_ret|text=|trigger=button}{sub-section}{sub-section:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_see|text=|trigger=button}{sub-section}{sub-section:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_see|text=|trigger=button}{sub-section}{sub-section:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_sam|text=|trigger=button}{sub-section}{sub-section:AE4E600C71BC4FAA-F2359665-42D547AD-A6EA81E8-C788D3313FB62DFF3C14CD31_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=518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA}{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:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_des|text=|trigger=button}{sub-section}{sub-section:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_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:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_prs|trigger=none}string {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_ret|text=|trigger=button}{sub-section}{sub-section:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_see|text=|trigger=button}{sub-section}{sub-section:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_see|text=|trigger=button}{sub-section}{sub-section:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_sam|text=|trigger=button}{sub-section}{sub-section:518309BFB5680903-B5167CCE-46F741A3-990CAE3F-01FCF9D56F7DDA48D8A3CABA_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