Home > Backend Development > PHP Tutorial > The difference between stream_socket_xxxx and socket_XXX in PHP

The difference between stream_socket_xxxx and socket_XXX in PHP

WBOY
Release: 2016-07-06 13:53:46
Original
1619 people have browsed it

After reading the manual, I don’t quite understand the connection between stream_socket_xxxx and socket_xxx

For example: stream_socket_recvfrom and socket_recvfrom are functionally the same except for different parameters

Is it understandable that one is an extension of the other?

For example: stream_socket_client and socket_create both seem to be able to create socket resources, and stream is more powerful

My little brother has nothing to show for it. I just want to ask if I don’t understand.

PS: Suddenly I saw another fsocketopen. Why are there so many socket variants?

Reply content:

After reading the manual, I don’t quite understand the connection between stream_socket_xxxx and socket_xxx

For example: stream_socket_recvfrom and socket_recvfrom are functionally the same except for different parameters

Is it understandable that one is an extension of the other?

For example: stream_socket_client and socket_create both seem to be able to create socket resources, and stream is more powerful

My little brother has nothing to show for it. I just want to ask if I don’t understand.

PS: Suddenly I saw another fsocketopen. Why are there so many socket variants?

stream_socket_xxxx is an encapsulation of some functions such as sockets
More protocols are supported
http://php.net/manual/zh/wrappers.php

Almost the same content
Post an answer
http://stackoverflow.com/questions/9760548/php-sockets-vs-streams/9783856#9783856
Anyway, it is recommended to use the stream_* function

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template