【发布时间】:2019-02-08 22:01:12
【问题描述】:
在 C# 中管理 GremlinClient 对象的最佳实践是什么?是创建一个 SingleInstance(通过依赖注入)还是在每次调用后在对象上使用 Dispose 或使用 using
using (var client = new GremlinClient(...))
{
var results = client.SubmitAsync(query);
}
由于它是与服务器的 Sockets 连接,我认为重用客户端是最佳做法,但我一直收到此错误并且我无法确定根本原因。
Unable to read data from the transport connection:
An existing connection was forcibly closed by the remote host.
【问题讨论】:
-
您使用的是哪个版本的 Gremlin.Net?是 3.4.0 吗?