Flex and Java Socket Communications (iii) multi-customer communications

Source: Internet
Author: User
Tags socket

Objective: To do a simple multiplayer scissors game. Each client communicates with a socket on the server, but the client does not communicate with each other. When a server receives a connection request from a client, it creates a new socket and makes it connect to the client. The thread then initiates the data exchange with the client. The socket manager is a vector that manages the number of sockets and their connection status.

Game Description: The player sends 0,1,2 this three digits to the server to represent the scissors, the hammer bag, the 袱. When the server receives the information, it randomly generates one of the three numbers 0,1,2. Judge or lose by comparison on the client.

First place Effect chart

Service side:

Client:

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.