News:

Wondering if this will always be free?  See why free is better.

Main Menu

Alternative to fgetc/fread?

Started by Søren Bjerg, July 12, 2005, 07:12:37 AM

Previous topic - Next topic

Søren Bjerg

I have this script on one of my sites, which makes it possible to query a game server based on the Unreal engine to make it return a bunch of server variables and player information, but since some time ago this script ceased to work. I then sent a question to the host's support department to ask how it could be, and I got told I couldn't use that script anymore. Bummer.

It pretty much only consists of a call to fsockopen, then fwrite, followed by a number of fgetc calls until all the information has been received... and since the first two works without a problem - when testing it one line at a time, it looks like the usage of fgetc (and fread) has been blocked on the server... forcing me into using an IFRAME solution with a local server, if I want to continue using the script

Now, I was wondering if there was an alternative to using fgetc/fread, that I could use and kickstart the script into working again?

:(
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

CapriSkye

can you use fgets()?
then you can specify how many characters it reads instead of newline or eof.

Søren Bjerg

Looks like that's a "no go" too - works on my local server, but it just hangs when uploading to the server :(.

I guess I'm allowed to open a connection to a remote location... but not to read from it. Ugh, why not just disallow opening connections to remote locations then?! >:(
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

morph

Would file work for what you are trying to do?

Coming soon!

Søren Bjerg

I'm afraid not.

This is pretty much the gist of it;

1) Establish socket connection via UDP.
2) Send '\status\' command via the socket connection.
3) Read the information sent back to the client until '\final\' has been received.
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

Advertisement: