tailieunhanh - Instant Messaging in Java phần 6

Đây là một nguy cơ cần thiết, bạn phải cho phép khách hàng trực tiếp kết nối đến máy chủ Jabber. Một trong các dịch vụ có giá trị nhất mà các máy chủ Jabber cung cấp cho khách hàng là nó cho phép hai khách hàng để trao đổi tin nhắn trong khi cả hai vẫn còn một cách an toàn phía sau tường lửa của riêng mình. | The Jabber server modifications 181 The Server typically uses thellserlndex to locate aWriter object listing with a given JabberlD. Two convenience methods make locatingWriter sby JabberlD simple by conducting the user and session writer lookup in one step. The Userindex getWriter convenience methods public Writer getWriter String jabberlD throws lOException return getWriter new JabberlD jabberlD public Writer getWriter JabberlD jabberlD throws lOException return getUser .getWriter The Userindex manages sessions as well as users listing . Fortunately all the work is done in the User class. So thdJserlndex methods only need to do some basic error checking. The Userindex session management methods public void addSession Session session User user getUser .getUser session session user public void removeSession Session session session if null return getUser .getUser .removeSession session III skip showing the very minor changes to other classes needed to support the new user account system. These include changes to thSession class to support session priorities and changes to the OpenStreamHandler and CloseStreamHandler classes that must now use thblserlndex rather than the Sessionindex to obtain sessionwriter objects for packet delivery. These minor changes are straightforward and included in the full source code available online. The one interesting helper class change is the nevMessageHandler class. A user-aware MessageHandler class The MessageHandler class must be modiẽd to use the new Userindex instead of the Sessionindex . In addition its packet delivery algorithm is changed in two important ways. First I have added a methoctleliverPacketToAIIO listing that delivers a packet to every session for a user. This is important for packets that alert all clients to user account updates. In addition the normal deliverPacketO .

TÀI LIỆU MỚI ĐĂNG
41    136    0    02-06-2024
24    119    0    02-06-2024
8    121    0    02-06-2024
8    105    0    02-06-2024
28    122    0    02-06-2024
4    101    0    02-06-2024
15    116    0    02-06-2024
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.