如何识别远程演员?

编程入门 行业动态 更新时间:2024-10-16 16:03:06
本文介绍了如何识别远程演员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个远程参与者(客户端),正在向另一个远程参与者(服务器)注册,然后注销(带有关闭挂钩)。但是,尽管服务器取消注册,但是实际的 发件人 属性是不同的Channel对象;所以在我的服务器日志中,我有:

I have a remote actor (client) which is registering with another remote actor (server) and then later deregistering (with a shutdown hook). However, although the server picks up the de-registration, the actual sender property is a different Channel object; so in my server logs I have:

注册新客户端[scala.actors.Channel@158e282];支持1个客户端 注销的客户端[scala.actors.Channel@1caf0b6];支持1个客户端

我如何确定(在服务器端)这是同一位客户端参与者最初向我注册的是哪个?显然,我可以给每个客户端使用自己的 UUID ,但是我想知道是否有更简单的方法吗?

How can I determine (on the server side) that this was the same client actor which originally registered with me? Obviously I could imbue each client with its own UUID but I wonder whether there is an easier way?

推荐答案

从对scala用户邮件列表的讨论来看,如果不使用某些替代类型的客户端标识符(例如 UUID )。如果从客户端在注册对象中发送自己引用,则会出现 ObjectNotSerializable 错误。

From a discussion on the scala users' mailing list, it seems that this is not immediately possible without using some alternative kind of client identifier (like UUID). If you send the self reference from the client in your registration object, you will get a ObjectNotSerializable error.

更多推荐

如何识别远程演员?

本文发布于:2023-11-25 23:05:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631706.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何识别   演员

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!