Questions tagged [fsockopen]

PHP function used to open (Internet or Unix domain) sockets connections.

382 questions
0
votes
0 answers

php telnet fgets returns strange characters

using fsockopen, fwrite & fegts to communicate with my account on a remote server over telnet using the following code: $ip = "*hosts*"; $user = "*username*"; $pass = "*password*"; $fp = fsockopen($ip, 23, $errno, $errstr, 30); if (!$fp) { …
Dave F
  • 180
  • 1
  • 1
  • 8
0
votes
2 answers

PHP - Get image with fsockopen

I am trying to grab an image from an external server with fsockopen in PHP. I need to get the image data into a variable in BASE64 encoding in my code. The image is a .jpeg file-type and is a small image. I could not find any answers on Google after…
Alexander Johansen
  • 522
  • 1
  • 14
  • 28
0
votes
1 answer

Curls vs fsockopen - what's faster

what's faster, CURL or fsockopen (POST request)? Maybe there is something faster than both of them? If not, then if I'll reuse curl's handle, will it be equal to reusing connection? (So connecting to server is skipped, only writing and receiving…
Denis Wróbel
  • 131
  • 1
  • 10
0
votes
1 answer

I have some problems with cheking the status of a server

I am trying to make a script where I can chek the server status (Online/Offline) for servers like: Teamspeek, Minecraft and others. I found this script:
0
votes
2 answers

Fsockopen times out on isps server

I have an apache server sunning at home for test purposes and I have an account with a uk isp. When using fsockopen on my home server everything works fine, I can connect on different ports (I am using specifically 25 for testing a mail server) but…
David
  • 1
0
votes
4 answers

How can a while() loop not stall when using fsockopen() and fgets() in PHP?

This is the basic connection code for a small PHP IRC bot. The problem is that it seems that the while() loop does not progress beyond fgets() until it receives data from the IRC server. I want the while() loop to iterate regardless if the IRC…
Equinox
  • 13
  • 3
0
votes
0 answers

Skipping a chunk of data when using fpassthru

I'm trying to set up a simple PHP script to emulate an audio file with fpassthru. However, the source that I'm pulling the content from naturally adds headers to the actual data-stream fetched by my PHP script, which I think is the reason my setup…
Johnny Cache
  • 9
  • 1
  • 6
0
votes
2 answers

How can two scripts use the same port at the same time?

I'm trying to set up a "server" script in PHP, which should run for a limited amount of time in the background. But multiple instances of this script may run at the same time. Unfortunately fsockopen() doesn't let me use the same port at the same…
thelolcat
  • 10,995
  • 21
  • 60
  • 102
0
votes
1 answer

php fsockopen() fail issue

I'm trying to use xml rpc in remote server. using codeigniter xml-rpc class. the xml rpc server didn't send any data. so i tracked the library and reached to here - parameters THIS->SERVER : 10.222.223.53 THIS->PORT : 80 THIS->errno :…
user1765884
  • 105
  • 1
  • 4
  • 13
0
votes
1 answer

php fsockopen() cannot make connection

I have a problem about fsockopen(). when i write code from http://tokudu.com/2010/how-to-implement-push-notifications-for-android it doesn't work, and i get: Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:port (No…
boea pj
  • 9
  • 6
0
votes
1 answer

fsockopen() [function.fsockopen]: unable to connect to

I have problem with fsockopen. My site works normal, but when I log in into admin panel (wordpress), I got this error message all over my screen: Warning: fsockopen() [function.fsockopen]: unable to connect to udp://:0 (Failed to parse address "")…
0
votes
3 answers

Possible to "que" fsockopen? Multiple TCP Sockets

I've got a script that currently creates a TCP socket via fsockopen() once per loop. Everytime it opens a connection, the entire PHP script pauses until it has been established. I'm wanting to go down the path of running 5 simultaneous sockets so I…
Richard Denton
  • 982
  • 2
  • 7
  • 13
0
votes
1 answer

Converting fsockopen() function to use cURL

Hi all I have some code that's being run through a foreach loop: if($fp = @fsockopen($value['privateip'],1935,$errCode,$errStr,.5)){ $value['alive'] = 'alive'; } else { $value['alive'] = 'down'; } …
slick1537
  • 745
  • 2
  • 8
  • 19
0
votes
1 answer

How to determine reponse time of fsockopen()

I am developing a project in which i am creating a socket using fsockopen() in a php script to connect to a java server on the same machine only. Is there anyway to know time it takes for a response to be returned for a request made to the java…
user2373603
  • 11
  • 1
  • 3
0
votes
1 answer

fsockopen() always returning true

Hi I am trying to incorporate a function in my project that will ping my app servers and see if they are running or not. Problem is, everytime I try to use this function it always returns that they are alive, even though I am in my local…
slick1537
  • 745
  • 2
  • 8
  • 19