All Bundles
UDPSocket
UDP/IP socket
Implements: InputStream, OutputStream
Operations
New
Default constructor
New(address:System.String, port:Int)
Parameters
Name | Type | Description |
---|
address | String | network address |
port | Int | network port |
Close
Closes the 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
GetAddress
Returns the connected network address
method : public : GetAddress() ~ String
Return
Type | Description |
---|
String | return network address |
GetLastError
Get the last error
function : GetLastError() ~ String
Return
Type | Description |
---|
String | last error message, or Nil of no error |
GetPort
Returns the connected network port
method : public : GetPort() ~ Int
Return
Type | Description |
---|
Int | return network port |
ReadBuffer
Reads bytes into a byte buffer
method : public : ReadBuffer(offset:Int, num:Int, buffer:Byte[]) ~ Int
Parameters
Name | Type | Description |
---|
offset | Int | destination buffer offset |
num | Int | number of values to read |
buffer | Byte[] | input buffer |
Return
Type | Description |
---|
Int | number of values read |
Reads bytes into a character buffer
method : public : ReadBuffer(offset:Int, num:Int, buffer:Char[]) ~ Int
Parameters
Name | Type | Description |
---|
offset | Int | destination buffer offset |
num | Int | number of values to read |
buffer | Char[] | input buffer |
Return
Type | Description |
---|
Int | number of values read |
ReadByte
Reads a byte
method : public : ReadByte() ~ Byte
Return
Type | Description |
---|
Byte | byte read |
ReadLine
Reads a string until a newline or character return is detected
method : public : ReadLine() ~ System.String
Return
Type | Description |
---|
String | character string |
WriteBuffer
Writes bytes from a byte buffer
method : public : WriteBuffer(buffer:Byte[]) ~ Int
Parameters
Name | Type | Description |
---|
buffer | Byte[] | input buffer |
Return
Type | Description |
---|
Int | number of values written |
Writes bytes from a byte buffer
method : public : WriteBuffer(offset:Int, num:Int, buffer:Byte[]) ~ Int
Parameters
Name | Type | Description |
---|
offset | Int | destination buffer offset |
num | Int | number of values to write |
buffer | Byte[] | input buffer |
Return
Type | Description |
---|
Int | number of values written |
Writes characters from a byte buffer
method : public : WriteBuffer(buffer:Char[]) ~ Int
Parameters
Name | Type | Description |
---|
buffer | Char[] | input buffer |
Return
Type | Description |
---|
Int | number of values written |
Writes characters from a character buffer
method : public : WriteBuffer(offset:Int, num:Int, buffer:Char[]) ~ Int
Parameters
Name | Type | Description |
---|
offset | Int | destination buffer offset |
num | Int | number of values to write |
buffer | Char[] | input buffer |
Return
Type | Description |
---|
Int | number of values written |
WriteByte
Writes a byte
method : public : WriteByte(b:Int) ~ Bool
Parameters
Name | Type | Description |
---|
b | Int | byte to write |
Return
Type | Description |
---|
Bool | true if byte was written, false otherwise |
WriteString
Writes a character string
method : public : WriteString(str:System.String) ~ Nil
Parameters
Name | Type | Description |
---|
str | String | string to be written |