The port is already listening, why Fsockopen will fail, how to handle it

Source: Internet
Author: User
Port is already in listening state, why Fsockopen will fail
View with netstat-a command, display TCP 0.0.0.0:2012 www:0 LISTENING
But with the PHP socket access, the code is as follows:
PHP Code
  
  $fp = Fsockopen (' 202.117.xxx.xxx ', $errno, $errstr, ten); Echo $fp;

Why do I also prompt unable to connect to 202.117.xxx.xxx:2012 (cannot connect because the target computer is actively rejecting it.) ?)?

------Solution--------------------
Isn't that the other person's refusal?

Ping 202.117.xxx.xxx:2012
Or
Telnet 202.117.xxx.xxx:2012

Look
------Solution--------------------
LocalHost to even try?
------Solution--------------------
PHP Code
$socket = Socket_create (Af_inet, Sock_stream, sol_tcp);   $connection = Socket_connect ($socket, ' 192.168.xxx.xxx ', 2012);
  • 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.