private void OnReplyPacketReceived(byte[] packetBytes) { ReplyPacketParser packet = new ReplyPacketParser(packetBytes, _IDSizes); uint id = packet.Id; WaitingOperationDescriptor waitingOperation = null; lock (_waitingOperations) { if (_waitingOperations.TryGetValue(id, out waitingOperation)) { _waitingOperations.Remove(id); } } if (waitingOperation != null) { try { waitingOperation.OnComplete(packet); } catch (JdwpException e) { waitingOperation.OnJdwpException(e); } } else { Debug.Fail("How did we get a reply packet that we don't have a waiting operation for?"); } }
internal override void DecodeSuccessReply(ReplyPacketParser reply) { _reply = new Reply(); _reply.description = reply.ReadString(); _reply.jdwpMajor = (int)reply.ReadUInt32(); _reply.jdwpMinor = (int)reply.ReadUInt32(); _reply.vmVersion = reply.ReadString(); _reply.vmName = reply.ReadString(); }
internal override void DecodeSuccessReply(ReplyPacketParser bytes) { int fieldIDSize = (int)bytes.ReadUInt32(); int methodIDSize = (int)bytes.ReadUInt32(); int objectIDsize = (int)bytes.ReadUInt32(); int referenceTypeIDSize = (int)bytes.ReadUInt32(); int frameIDSize = (int)bytes.ReadUInt32(); _reply = new IDSizes(fieldIDSize, methodIDSize, objectIDsize, referenceTypeIDSize, frameIDSize); }
internal void OnComplete(ReplyPacketParser replyPacket) { if (replyPacket.Succeeded) { _command.DecodeSuccessReply(replyPacket); _completionSource.SetResult(null); } else { _command.DecodeFailureReply(replyPacket); _completionSource.SetException(new JdwpException(ErrorCode.CommandFailure, string.Format(CultureInfo.CurrentCulture, "JDWP Error. Id: {0} Error Code: {1}", replyPacket.Id, replyPacket.ErrorCode))); } }
internal override void DecodeSuccessReply(ReplyPacketParser bytes) { int countClasses = (int)bytes.ReadUInt32(); _classData = new List <ClassData>(); for (int i = 0; i < countClasses; i++) { ClassData classData = new ClassData(); classData.refTypeFlag = bytes.ReadByte(); classData.typeID = bytes.ReadReferenceTypeID(); classData.signature = bytes.ReadString(); classData.genericSignature = bytes.ReadString(); classData.status = (int)bytes.ReadUInt32(); _classData.Add(classData); } }
internal virtual void DecodeFailureReply(ReplyPacketParser bytes) { }
//overriden by commands that need to decode reply payloads internal virtual void DecodeSuccessReply(ReplyPacketParser bytes) { }