Network Card
Parent |
Functions
broadcast (port : Int, …)
Sends a network message to all components in the network message network (including networks sepperated by network routers) on the given port. The data you want to add can be passed as additional parameters. Max amount of such parameters is 7 and they can only be nil, booleans, numbers and strings.
Details
Flags |
VarArgs RuntimeSync RuntimeParallel MemberFunc |
Display Name |
Broadcast Message |
| Name | Type | Description |
|---|---|---|
Port |
Int |
The port on which the network message should get sent. For outgoing network messages a port does not need to be opened. |
closeAll ()
Closes all ports of the network card so no further messages are able to get received
Details
Flags |
RuntimeSync RuntimeParallel MemberFunc |
Display Name |
Close All Ports |
close (port : Int)
Closes the given port so the network card wont receive network messages on the given port.
Details
Flags |
RuntimeSync RuntimeParallel MemberFunc |
Display Name |
Close Port |
| Name | Type | Description |
|---|---|---|
Port |
Int |
The port you want to close. |
open (port : Int)
Opens the given port so the network card is able to receive network messages on the given port.
Details
Flags |
RuntimeSync RuntimeParallel MemberFunc |
Display Name |
Open Port |
| Name | Type | Description |
|---|---|---|
Port |
Int |
The port you want to open. |
send (receiver : String, port : Int, …)
Sends a network message to the receiver with the given address on the given port. The data you want to add can be passed as additional parameters. Max amount of such parameters is 7 and they can only be nil, booleans, numbers and strings.
Details
Flags |
VarArgs RuntimeSync RuntimeParallel MemberFunc |
Display Name |
Send Message |
| Name | Type | Description |
|---|---|---|
Receiver |
String |
The component ID as string of the component you want to send the network message to. |
Port |
Int |
The port on which the network message should get sent. For outgoing network messages a port does not need to be opened. |
Signals
NetworkMessage (String Sender sender, Int Port port, …)
Triggers when the network card receives a network message on one of its opened ports. The additional arguments are the data that is contained within the network message.
Details
| Name | Type | Description |
|---|---|---|
Sender |
String |
The component id of the sender of the network message. |
Port |
Int |
The port on which the network message got sent. |