v2026.5.3
All Bundles
Bundle Provides network support

UDPSocketServer

UDP/IP Server socket

Operations

Bind #

Binds the UDP server socket

method : public : Bind() ~ Bool

Return

TypeDescription
Booltrue if successfully bound, false otherwise

Close #

Closes the server socket

method : public : Close() ~ Nil

Flush #

Flushes the output buffer. This is a no-opt given this socket is not backed by an output buffer.

method : public : Flush() ~ Nil

GetLastError # function

Get the last error

function : GetLastError() ~ String

Return

TypeDescription
Stringlast error message, or Nil of no error

IsBound #

Checks if the UDP server socket is bound

method : public : IsBound() ~ Bool

Return

TypeDescription
Booltrue if successfully bound, false otherwise

New # constructor

Default constructor

New(port:Int, bind:Bool)

Parameters

NameTypeDescription
portIntserver port
bindBoolbind to port on creation, default is true

ReadBuffer #

Reads bytes into a byte buffer

method : public : ReadBuffer(offset:Int, num:Int, buffer:Byte[]) ~ Int

Parameters

NameTypeDescription
offsetIntdestination buffer offset
numIntnumber of values to read
bufferByteinput buffer

Return

TypeDescription
Intnumber of values read

ReadBuffer #

Reads bytes into a character buffer

method : public : ReadBuffer(offset:Int, num:Int, buffer:Char[]) ~ Int

Parameters

NameTypeDescription
offsetIntdestination buffer offset
numIntnumber of values to read
bufferCharinput buffer

Return

TypeDescription
Intnumber of values read

ReadByte #

Reads a byte

method : public : ReadByte() ~ Byte

Return

TypeDescription
Bytebyte read

ReadLine #

Reads a string until a newline or character return is detected

method : public : ReadLine() ~ System.String

Return

TypeDescription
Stringcharacter string

WriteBuffer #

Writes bytes from a byte buffer

method : public : WriteBuffer(buffer:Byte[]) ~ Int

Parameters

NameTypeDescription
bufferByteinput buffer

Return

TypeDescription
Intnumber of values written

WriteBuffer #

Writes bytes from a byte buffer

method : public : WriteBuffer(offset:Int, num:Int, buffer:Byte[]) ~ Int

Parameters

NameTypeDescription
offsetIntdestination buffer offset
numIntnumber of values to write
bufferByteinput buffer

Return

TypeDescription
Intnumber of values written

WriteBuffer #

Writes characters from a byte buffer

method : public : WriteBuffer(buffer:Char[]) ~ Int

Parameters

NameTypeDescription
bufferCharinput buffer

Return

TypeDescription
Intnumber of values written

WriteBuffer #

Writes characters from a character buffer

method : public : WriteBuffer(offset:Int, num:Int, buffer:Char[]) ~ Int

Parameters

NameTypeDescription
offsetIntdestination buffer offset
numIntnumber of values to write
bufferCharinput buffer

Return

TypeDescription
Intnumber of values written

WriteByte #

Writes a byte

method : public : WriteByte(b:Int) ~ Bool

Parameters

NameTypeDescription
bIntbyte to write

Return

TypeDescription
Booltrue if byte was written, false otherwise

WriteString #

Writes a character string

method : public : WriteString(str:System.String) ~ Nil

Parameters

NameTypeDescription
strStringstring to be written