public class Packet
extends java.lang.Object
IPacketNetwork
.Constructor and Description |
---|
Packet(int channel,
int replyChannel,
java.lang.Object payload,
IPacketSender sender)
Create a new packet, ready for transmitting across the network.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
getChannel()
Get the channel this packet is sent along.
|
java.lang.Object |
getPayload()
The actual data of this packet.
|
int |
getReplyChannel()
The channel to reply on.
|
IPacketSender |
getSender()
The object which sent this message.
|
int |
hashCode() |
public Packet(int channel, int replyChannel, java.lang.Object payload, IPacketSender sender)
channel
- The channel to send the packet along. Receiving devices should only process packets from on
channels they are listening to.replyChannel
- The channel to reply on.payload
- The contents of this packet. This should be a "valid" Lua object, safe for queuing as an
event or returning from a peripheral call.sender
- The object which sent this packet.public int getChannel()
public int getReplyChannel()
public java.lang.Object getPayload()
public IPacketSender getSender()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object