Java Chat Room Applet-client code implementation aspect

Source: Internet
Author: User

The implementation effect of the client

1. Log on to the server, if the server port number and IP number entered the characters are "0", the client connects to the default server

2. Enter Chat Nickname

3. Enter "-quit" will automatically exit chat

4. Enter "-getlist" will get the name of the online user

5. Input "-to < user name > < chat information >" will send the information to the specified user, others can not see

6. Input "-help" will get the client to do the appropriate operation help

6. Direct input content will be sent to all online users

Classes and methods of the client

1. Establish the connection method: ConnectServer (String ip,int Port)

2. Disconnect method: Disconnectserver ()

2. Send Message method: Sendmes (String mes)

3. Accept Message Method: Getmes ()

4. Receive one message: Getmesonce ()

5. Get user list: GetList (String mes)

6. Test Connection method: Testconnect (String ip,int Port)

7. Check User name: Checknickname (String nickname)

8. Get help list: Helplist ();

9. The input of each content is carried out in the Main method

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.