Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Jersey 为 SSE EventSoruce提供了 java API 。但不清楚客户端何时应该关闭它 - 当服务器关闭连接时,客户端如何得到通知?有没有人这样做过?
如果这个问题仍然相关:)
当您关闭服务器或想要关闭连接时关闭它。在您这样做之前,连接将保持打开状态 - 除非客户端断开连接,或者发生某种 IO 异常。
换句话说 - 服务器会处理所有事情,但您应该知道何时要断开连接。
(Y)