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 Link to comment https://forums.phpfreaks.com/topic/223815-irc-socket-connect/ 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.. Link to comment https://forums.phpfreaks.com/topic/223815-irc-socket-connect/#findComment-1156873 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 Link to comment https://forums.phpfreaks.com/topic/223815-irc-socket-connect/#findComment-1157024 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.