问题标签 [zeroformatter]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
10699 浏览

redis - 如何将字节数组存储到 StackExchange.Redis?

我想使用MessagePack,ZeroFormatterprotobuf-net序列化/反序列化通用列表并使用客户端将其存储在 Redis 中stackexchange.redis

现在我使用该StringSetAsync()方法存储一个 JSON 字符串。但我找不到任何关于如何byte[]在 Redis 中存储 a 的文档。

0 投票
2 回答
2396 浏览

serialization - System.InvalidProgramException:公共语言运行时检测到无效程序

全部,

我正在使用 ZeroFormatter 对大对象进行序列化,有时在序列化错误时会出现以下错误,在使用 ZeroFormatter 的 Union 概念进行继承后会观察到此问题。

以下是异常详细信息:

System.InvalidProgramException:公共语言运行时检测到无效程序。
在 ZeroFormatter.DynamicObjectSegments.ZeroFormatter_Formatters_DefaultResolver.Colibrium.Common.Ontology.Rating.Factors.RateFactor$Formatter.Serialize(Byte[]& , Int32 , RateFactor )
在 ZeroFormatter.Formatters.CollectionFormatter 3.Serialize(Byte[]& bytes, Int32 offset , TCollection 值) 在 ZeroFormatter.DynamicObjectSegments.ZeroFormatter_Formatters_DefaultResolver.Colibrium.Common.Ontology.Rating.PackagePlan$Formatter.Serialize(Byte[]& , Int32 , PackagePlan ) 在 ZeroFormatter.Formatters.CollectionFormatter 3.Serialize(Byte[]& bytes, Int32 偏移量,TCollection 值)3.Serialize(Byte[]& bytes, Int32 offset, TCollection value)
at ZeroFormatter.DynamicObjectSegments.ZeroFormatter_Formatters_DefaultResolver.Colibrium.Common.Ontology.Rating.RateClass$Formatter.Serialize(Byte[]& , Int32 , RateClass )
at ZeroFormatter.Formatters.CollectionFormatter


3.Serialize(Byte[]& bytes, Int32 offset, TCollection value)
at ZeroFormatter.DynamicObjectSegments.ZeroFormatter_Formatters_DefaultResolver.Colibrium.Common.Ontology.Rating.Package$Formatter.Serialize(Byte[]& , Int32 , Package )
at ZeroFormatter.Formatters.CollectionFormatter

在 ZeroFormatter.DynamicObjectSegments.ZeroFormatter_Formatters_DefaultResolver.Colibrium.Common.Ontology.Rating.PackageGroup$Formatter.Serialize(Byte[]& , Int32 , PackageGroup )
在 ZeroFormatter.Formatters.CollectionFormatter 1.Serialize[T](T obj) 在 Colibrium.Utility .Library.ObjectConverter`1.ConvertO bjectToBinaryZeroFormatter(T p_object)3.Serialize(Byte[]& bytes, Int32 offset, TCollection value)
at ZeroFormatter.DynamicObjectSegments.ZeroFormatter_Formatters_DefaultResolver.Colibrium.Common.Ontology.Rating.Group.GroupRatingResults$Formatter.Serialize(Byte[]& , Int32 , GroupRatingResults )
at ZeroFormatter.ZeroFormatterSerializer.CustomSerializer

在 C:\TFS\UPMC\Repos\Colibrium.Utility.Library\ObjectConverter.cs:407 行

0 投票
0 回答
443 浏览

c# - NetMQ 的性能限制

我正在从我的 10G 网络上的各个地方发送消息。我正在使用发布/订阅模式。

我发送的消息使用 zeroFormatter 进行序列化,长度约为 270 字节。

一旦我开始每秒发送超过 150K 的消息,我注意到订阅者开始错过消息。

我如何计算出我可以发送的限制是多少?

编辑1:

我发送的速度不到 10 亿比特/秒,这是我网络容量的十分之一。在此之后,我开始错过消息。这会是由于CPU问题吗?发送者或接收者似乎都没有被高度利用......

0 投票
0 回答
288 浏览

c# - 是否可以对列表进行归零?

我想序列化一个类类型的列表:

但是当我尝试执行此操作时出现以下错误:

Message=Type 不受支持,发生无效错误:List 1 InnerException:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Type is not supported, occurs invalid error: TradeData InnerException:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Access is denied: 'Cobra.Simulz+TradeData'. at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule module, Int32 tk, ObjectHandleOnStack type) at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock() at System.Reflection.Emit.TypeBuilder.CreateTypeInfo() at System.Lazy1.CreateValue() at System.Lazy 2[] memberInfos) at ZeroFormatter.Formatters.DynamicFormatter.CreateTTypeResolver,T at ZeroFormatter.Formatters.Formatter.GetBuiltinFormatter[TTypeResolver,T]( Type t, TTypeResolver resolver) 在 ZeroFormatter.Formatters.Formatter 2.GetLength() 在 ZeroFormatter.Formatters.CollectionFormatter 2..cctor() Source=ZeroFormatter1.LazyInitValue() --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at ZeroFormatter.Formatters.DynamicFormatter.BuildFormatter(ModuleBuilder builder, Type resolverType, Type elementType, Tuple

2..cctor() at ZeroFormatter.Formatters.ErrorFormatter3..ctor() --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at ZeroFormatter.Formatters.Formatter.GetBuiltinFormatter[TTypeResolver,T](Type t, TTypeResolver resolver) at ZeroFormatter.Formatters.Formatter