Control remote clients status on TCP connections

旧街凉风 提交于 2019-12-12 02:59:59

问题


I need to write a platform with a centralized server and a lot of remote clients to execute tasks. I'm currently using an RMI connection, being the centralized server who acts as client of the remote clients (RMI servers). It's working, but I'm afraid of have a lot of problems in a near future (is a good idea to use RMI?) so I'm thinking in move the code to SSLSockets and send serialized classes to do the same.

My problem with this approach y how to control the list of active clients. I need to have connection data to send tasks and I need to know if they are alive. Any idea?

Thanks in advance for your help.


回答1:


There is no such thing as an 'RMI connection', but you can accomplish what you want via the RMI Remote Session pattern (Google it) plus implementing the Unreferenced interface on the remote session objects, which will tell you when the client is no longer current, if they haven't already called the session logout method, if you provide it.

See this answer for details of the Remote Session pattern.



来源:https://stackoverflow.com/questions/15334926/control-remote-clients-status-on-tcp-connections

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!