Posted for MRARSENAL10: Xin giúp đỡ viết chương trình chat peer to peer

Joe

Thành viên VIP
21/1/13
2,898
1,293
113
Xin chào Joe,
Mình đang viết chương trình chat peer to peer , thầy hướng dẫn bảo tạo 2 luồng , 1 luồng server, 1 luồng client nhưng mình vẫn chưa rõ lắm. Mong Joe có thể gợi ý cho mình ?
Cám ơn Joe.
____________________________________________________________________________________
Correct that every web-based communication should implement with THREADS. I give you here a brief explanation about such a communication for a "Chat peer-to-peer" implementation.

- On the Server site a SERVER thread waits for ALL incoming "clients" (or chatters) and delegates every request of a client to a SERVING thread that does the communication with the client and/or handles the chats between other chatters.
- On the Client site you don't need threading because you, as a client, interact directly via the web-Chat Server with other participants. If you are a pro you can implement a threading client that can handle simultaneously different participants as if you were a person with "multiple" personalities.

Your question is a big issue and I don't want to help you privately, but only publicly in this thread. Sorry. Please study the following threads before you could raise your questions that you haven't understood.

1) http://congdongjava.com/forum/threads/from-a-chatroom-to-a-forum.16501/
2) http://congdongjava.com/forum/threads/help-anh-chị-giúp-em-về-làm-webchat.16526/
3) http://congdongjava.com/forum/threads/help-giao-diện-chat-client-server-dùng-tcp.17060/
4) http://congdongjava.com/forum/threads/networking-chatroom-as-a-framework.16492/