/// <summary> /// Does the out in op. /// </summary> private T DoOutInOp <T>(ClientOp opId, Action <BinaryWriter> writeAction, Func <IBinaryStream, T> readFunc) { return(_socket.DoOutInOp(opId, stream => { if (writeAction != null) { var writer = _marsh.StartMarshal(stream); writeAction(writer); _marsh.FinishMarshal(writer); } }, readFunc)); }
/** <inheritdoc /> */ public BinaryType GetBinaryType(int typeId) { return(_socket.DoOutInOp(ClientOp.BinaryTypeGet, s => s.WriteInt(typeId), s => s.ReadBool() ? new BinaryType(_marsh.StartUnmarshal(s), true) : null)); }