Jump to content

IRC socket connect


joethetree

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.