Home > Article > Web Front-end > Can javascript use sockets?
Socket cannot be used in JavaScript. Although JavaScript does not support socket protocol transmission, js and flash can be used to call each other. Flash supports socket protocol transmission, so JavaScript can use socket indirectly.
The operating environment of this tutorial: Windows 10 system, JavaScript version 1.8.5, Dell G3 computer.
js does not support socket protocol transmission; js and flash can be used to call each other, and flash supports socket protocol transmission, indirectly realizing javascript using socket
One The data packet is generated by the application program and enters the protocol stack for packaging of various message headers. Then the operating system calls the network card driver to instruct the hardware to send the data to the opposite host.
What is Socket
A data packet is generated by the application program, enters the protocol stack for packaging of various message headers, and then the operating system calls the network card driver Command the hardware to send data to the opposite host.
The general diagram of the entire process is as follows:
[Related recommendations: javascript video tutorial, web front-end】
The above is the detailed content of Can javascript use sockets?. For more information, please follow other related articles on the PHP Chinese website!