Comments (5)
我想到的办法就是去检测任务管理器里面是否有xxx进程,但是我觉得不是很合理吧?我觉得HandyIpc里面自带会好一点吧?
from handyipc.
这个确实有考虑,但其实也是一个辅助功能,它和另一个需求是有联系的:检查服务器是否为单例。
也就是单例进程,这个一般用 EventWaitHandle
实现,参考:ProcessController.cs
from handyipc.
才疏学浅,才看半天没有看明白,请问一下ProcessController
怎么使用呢?
ProcessControllerProcessController.IsDuplicateInstance("JgkljServe");
不管运行了JgkljServe.exe还是没有运行,他都是返回的false
from handyipc.
它核心原理是 EventWaitHandle
,相当于一个可以在进程间共享的信号,你可以去查一下它的使用方法。
from handyipc.
感谢作者的解答,get到了新知识,但是它并不能解决问题,可能在库内部没有是否连接的方法前,我只能去检测进程。
我看的这篇文章:https://www.qxqzx.com/contents/674.html
他有一个问题,在服务端创建后在关闭,强制关闭等。。客户端还是返回的存在(应该是不存在)。
此EventWaitHandle
我看官方文档是一般用于异步同步的。
from handyipc.
Related Issues (18)
- 合同接口(IpcContract)支持事件 HOT 1
- 完善测试用例
- ArgumentException: Could not cast or convert from System.String to System.Type. HOT 6
- 如果断开client 之后, server 就会占用大量CPU HOT 6
- The bytes is not valid response data. HOT 4
- 长时间运行会出现 attempted to read or write protected memory HOT 7
- 在Net6环境下,Client关闭后,服务占用的CPU居高不下 HOT 3
- 不能4个包合并成一个吗? HOT 3
- 是否可以尝试去掉System.ValueTuple? HOT 2
- 内存是否哪里没有释放干净? HOT 2
- Error running example from README.md HOT 2
- 能否支持 直接注册实例, 现在只能注册类型。 HOT 1
- 开启可控引用类型特性(#nullable enable)后,生成的代码中包含错误的语句:typeof(object?)
- 语法分析无法识别所有形式的 [IpcContractAttribute]
- 支持在 rpc 方法中使用回调函数 HOT 1
- IpcContract 接口支持 IDisposable 接口
- 为所有 public api 添加注释
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from handyipc.