Example of sending and receiving data through Socket-PHP source code

Source: Internet
Author: User
Ec (2); Socket problems are frequently found online ~ Tutorial ~ But they are very official. In fact, we all know the code (this is available in the F1 help document), but because there is no measurable Socket server .. we have never been able to perform tests and further research. Flash bar new Community + MT: G, {, P +? B7z opened the "easy language" that has been useless for a long time today, a simple socket server .. in fact, I don't know whether it is a socket server. I only listen to the port, receive data from the client, and send data to the client script ec (2); script

There are oftenSocketProblem ~ Tutorial ~ But they are very official. In fact, we all know the code (this is available in the F1 help document), but because there is no measurable Socket server .. we have never been able to perform tests and further research. Flash bar new Community + MT: G, {, P +? B7z
Today, I opened the "easy language" that has been useless for a long time, a simple socket server .. in fact, I don't know whether it is a socket server. I only listen to the port, receive data from the client, send data to the client, and so on. HoweverFlashUnder the socket routine, the connection and sending and receiving are successful .. (ps: Easy language, a Chinese programming software. Don't laugh at me, hehe. I'm not from science and have no culture, however, I think this software is sufficient for the premise that I only need to help with flash learning. Here, it is also used as an advertisement for easy language. It is also something developed by Chinese people)

This small Dongdong is very simple. It automatically listens to port 8080 at startup, and displays the Client ip address when flash is connected. When flash sends dataServerThe received data is broadcast to all clients (Simple chat rooms can be used)

Upload a Flash instance .. it is modified only by the Flash routine .. after running, the system will directly connect to port 8080 of the Local Machine. After the connection is successful, a text will be sent to the server .. then the server returns the text .. in the "output" window, you can see.

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.