0
votes

I'm trying to connect to a device via telnet using PHP code below,

$fp = fsockopen("xx.xx.xx.xx", 11011, $errno, $errstr, 120);

but I'm getting error "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)"

I can connect OK to that same device using Windows Command Prompt with simple "telnet xx.xx.xx.xx 11011". Device doesn't require user/pass.

I have already tried increasing the timeout period.

  1. What could be wrong here?
  2. Is it possible the device has some kind of firewall preventing connection from PHP/fsockopen?
  3. How is connecting thru Command Prompt different from connecting thru PHP in terms of protocol used?
  4. Will appreciate any ideas/reference on how to connect and issue telnet command using PHP.

Thanks.

1
I may be wrong, but I didn't think telnet was just a raw socket listener. There is probably some negotiation that's failing.Scovetta

1 Answers

0
votes

Figured the error appears only when I'm trying to connect to the device from PHP while still connected to it with either Command Prompt or Putty. Seems like the device allows one concurrent connection only from each client.