joethetree Posted January 8, 2011 Share Posted January 8, 2011 Hey, I've had this problem for a couple days now, and haven't been able to work it out. I'm trying to connect to the Gamesurge IRC using PHP - though the code I am using times out and can't connect. I thought it was my code, however I have searched the web for working codes and they all *seem* to do the same basic thing as mine. So if anyone has any ideas as to why I am getting a timeout, I would appreciate it. The code I'm using. <?php error_reporting(E_ERROR); $cfg = array( "server" => "irc.gamesurge.net", "channel" => "#wiremod", "port" => 6667, "name" => "thetree PHP" ); echo "Connecting to " . $cfg["server"] . " on port " . $cfg["port"] . "<br/>"; $socket = fsockopen($cfg["server"], $cfg["port"], $errno, $errstr, 5); if (!$socket) { echo("Error[$errno]: $errstr...<br/>"); } else { echo "Socket connection successful..<br/>"; } fclose($socket); ?> Hosted file: http://joethetree.lil.org.uk/socket.php Thanks thetree Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 9, 2011 Share Posted January 9, 2011 Is this on a hosted site? Have you checked with the host to make sure you can access that port? All I did was paste it in locally, and got this: Connecting to irc.gamesurge.net on port 6667 Socket connection successful.. Quote Link to comment Share on other sites More sharing options...
joethetree Posted January 9, 2011 Author Share Posted January 9, 2011 I guess its my host then. Yeah, I've just run it through XAMPP and it works. Thanks for the help Though I accidentally spammed the server for about 0.25 seconds, and am now banned Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.