@Override public void onReceive(Integer from, int protocol, byte[] msg) { if (protocol == Protocol.DATA) { RIOLayer.RIODataReceive(from, msg); } else if (protocol == Protocol.ACK) { RIOLayer.RIOAckReceive(from, msg); } }
@Override public String toString() { return RIOLayer.toString(); }
/** * Send a message using the reliable, in-order delivery layer * * @param destAddr The address to send to * @param protocol The protocol identifier of the message * @param payload The payload of the message * @param callback Callback called when the network layer has finished with the packet, for better * or for worse. See ReliableInOrderMsgLayer.sendRIOPacket. * @return The sequence number of the packet, or -1 if a sending error occurred. */ public int RIOSend(int destAddr, int protocol, byte[] payload, Callback callback) { return RIOLayer.RIOSend(destAddr, protocol, payload, callback); }
/** * Send a message using the reliable, in-order delivery layer * * @param destAddr The address to send to * @param protocol The protocol identifier of the message * @param payload The payload of the message */ public void RIOSend(int destAddr, int protocol, byte[] payload) { RIOLayer.RIOSend(destAddr, protocol, payload); }