Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_agent.GetConnectionState(connId) result 6422588 #18

Closed
yj-zhang opened this issue Jun 25, 2021 · 9 comments
Closed

_agent.GetConnectionState(connId) result 6422588 #18

yj-zhang opened this issue Jun 25, 2021 · 9 comments

Comments

@yj-zhang
Copy link

When I use TcpPullAgent, call GetConnectionState() Back 6422588

code show as below:
LogHelper.WriteLog($"{_agent.GetConnectionState(connId).ToString()} connId = {connId}");

The print information is as follows:
6422588 connId = 1

Normally should show:
Connected connId = 1

Looking forward to your answer,thank you

@int2e
Copy link
Owner

int2e commented Jun 29, 2021

能提供一个可重现的demo吗

@yj-zhang
Copy link
Author

yj-zhang commented Jun 29, 2021 via email

@int2e
Copy link
Owner

int2e commented Jul 4, 2021

能提供个重现的demo我才好测试

@yj-zhang
Copy link
Author

yj-zhang commented Jul 4, 2021 via email

@yj-zhang
Copy link
Author

yj-zhang commented Jul 5, 2021

你好!我写了一个demo,可以复现问题。
demo链接
项目中附带了几张截图和一个文档,里面记录了一些问题!

@int2e
Copy link
Owner

int2e commented Jul 8, 2021

ok 我现在看看

@int2e
Copy link
Owner

int2e commented Jul 8, 2021

已经找到问题了, 是因为设置了连接超时时间, 定时器的回调函数中有个指针释放位置不正确的bug导致的这个问题, 稍后我马上发布新的nuget包, 请更新到最新版本.

另外
6、_agent.Connect("127.0.0.1", 5555, out connId),这种调用方法有可能出现调用返回后connId还没有分配地址的情况吗(分配的时间比返回时间晚)?项目中出现过这条语句后紧接着使用connId变量导致报错:空引用异常;但是报错在vs中查看时connId却不是空引用了;
7、问一个问题,使用您这个库时输出目录会自动附带上HPSOCKET4C.dll吗?我创建了两个项目一个会自动附带一个不会自动附带,是有哪里进行设置吗?
8、HPSOCKET4C.dll如何改变在输出目录的引用位置,只能和执行文件在同级目录吗?我想放到指定目录,但是尝试环境变量和指定privatePath都不行;

6: 这个不会, 如果能用稍后的最新版本复现才能查出问题, 否则我怀疑跟定时器是同个问题, 再观察下吧.

7: nuget包是会附带dll到输出目录的, 如果你是在core或者.net5运行程序没有问题, 却看不到dll, 应该是在exe的runtimes\win-x64 或 runtimes\win-x86 目录下, 这个.net core / .net 5 与.net framework是不同的, 可以自行查资料, 当然如果runtimes\* 目录下没有 ,放exe目录也是可以的

8: 实际上你不用动源码, .net core或.net5项目参考 [项目exe].deps.json的配置, 网上查资料, .net framework的项目只要你的dll在系统或当前用户的环境变量目录或者exe目录均可以被找到, 当然.net core或.net 5的项目同理

@int2e int2e closed this as completed in 58d5f98 Jul 8, 2021
@yj-zhang
Copy link
Author

yj-zhang commented Jul 8, 2021 via email

@int2e
Copy link
Owner

int2e commented Jul 8, 2021

如果你有dll目录的疑问,可以加我的qq,我给你远程看一下.
qq:1013706666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants