public void SendRequest(DsiCommand command, byte[] payload, AfpTransportReplyHandler replyHandler = null) { DsiHeader header = new DsiHeader() { command = command, flags = DsiFlags.Request, requestId = this.NextRequestId(), errorCodeOrWriteOffset = 0, totalDataLength = (uint)payload.Length }; AfpStream stream = new AfpStream(); header.Write(stream); stream.WriteBytes(payload); if (replyHandler != null) { _replyHandlers[header.requestId] = replyHandler; } byte[] result = stream.ToByteArray(); this.SendBuffer(result); }
public void SendRequest(DsiCommand command, byte[] payload, AfpTransportReplyHandler replyHandler = null) { DsiHeader header = new DsiHeader() { command = command, flags = DsiFlags.Request, requestId = this.NextRequestId(), errorCodeOrWriteOffset = 0, totalDataLength = (uint)payload.Length }; AfpStream stream = new AfpStream(); header.Write(stream); stream.WriteBytes(payload); if (replyHandler != null) { _replyHandlers[header.requestId] = replyHandler; } byte[] result = stream.ToByteArray(); this.SendBuffer(result); }