且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Java RMI中,客户端如何知道其服务器已经死机?

更新时间:2023-10-17 21:02:52

所以似乎没有人回答这个......你怎么样?知道某件事是否已经死了而没有与之交互?

So nobody seems to be answering this ... How would you know if something is dead without interacting with it?

在IRC中,服务器会定期ping客户端以检查它们是否仍然连接......你会看到平安! Pong!在客户端窗口中,有时客户端会尝试发送消息,发现它没有连接。

In IRC the server will periodically ping clients to check that they're still connected ...You will see Ping! Pong! in the client window and sometimes a client will attempt to send a message only to find that it has no connection.

如果你是担心开销......只是不经常这样做

If you are worried about overhead .. just don't do it so often