Problems in finding the socket Fsockopen of a group

Source: Internet
Author: User
The problem of finding the group socket Fsockopen
Socket Fsockopen Curl How can these things be understood? What's the difference between them? And what are the parameters to understand? Do you have any good information?
Curl Socket Fsockopen

Share to:


------Solution--------------------
A socket is a way to connect, such as to connect an interface.
Such as:

$fp = @fsockopen (' address ', ' Port ');
$command = "" //Send data, you want to send what data, it is written here, can be stitched together.
if (!fwrite ($FP, $command)) {exit (' Error ');}
$response = ";//Result set
while (!feof ($fp)) {
$str = fgets ($fp, 1024);//read each row of data
$response. = $str; Read each row to the result set
}
echo $response;//output result



Curl can be transmitted via a URL, which is typically used to simulate a certain action, such as: a simulated login.
------Solution--------------------
Socket you can understand is a kind of communication.
Fsockopen (' Connection address ', ' Port number ', ' Error code ', ' Error message ', ' timeout '), parameter is the address of the connection

There's nothing to do with the connection between the socket and curl.

And curl's understanding, for example:

Usually when we request the interface, the data of the other party may have been encrypted multiple times.
Then we have to use curl to encrypt the transmission when we ask for it, because normally we don't know what the data is encrypted.
------Solution--------------------
Socket is a tool library for TCP/IP communication protocol to simplify the writing of TCP/IP communication programs
Fsockopen is a simple socket package
Curl is another tool library for TCP/IP communication protocol
------Solution--------------------
Sockets are abstract sockets and are not part of a language like PHP
Fsocket is a PHP package for sockets, and C also has a similar package
Curl seems to be a PHP-specific class library, specifically to simplify the socket operation, a lot of host vendors to shield off the fsocket, but support curl, Baidu Bae is so dry
------------------------------------------------------autocsdn signature file --------------------------------- ---------------------

Yard Farm--code farming code, grazing ideas Farm!

------Solution--------------------
Agreement
Since it is communication, it is natural to have an agreement. The value is the protocol.

Otherwise, I speak Russian, you speak English, you can't say it together.
------Solution--------------------
  • 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.