Java Chat Room Applet-server code implementation aspect

Source: Internet
Author: User

Server implementation Effect:

1. Input-help to get all the commands on server operation

2. Input-run into the server contents initialization

3. Enter-stop Disconnect Server

4. Enter-quit to disconnect the server and exit the operation

5. After the server is successfully created, the Listener client information is run through a separate thread (Listenlink)

6. After the server receives the data, it transfers the data to the Data Analyzer (analysemes) processing

7. When the user determines the connection and identifies the nickname, the server stores the user's address and name in the Infomemory.

Classes and methods of the server:

1. Test Server creation: TestServer (String ip,int Port)

2. Initialize server: Initserver (String ip,int Port)

3. Determine IP and Port:fixserverlink (String ip,int Port)

4. Information listener: Listenlink ()

5. Data Analyzer: Analysemes (String mes)

6. Get address user name: Getconsumername (socketaddress sa)

7. Data forwarder: transformes (String mes)

8. Data Single repeater: Transformessingle (socketaddress adr,string mes)

9. Stop server: Cutserver ()

10. Get help list: Helplist ()

11. Error Tip method: Errortip (String str)

12. In the main function to do the appropriate action

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.