Connecting to TOC2 (AIM) Server & sending & receivin
Posted: Sat Mar 25, 2006 6:23 am
feyd | Please use
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
im trying to connect to the toc2 (AIM) server and send a instant messeger to people thru php. im not sure if its sending the data i need to the server or not. here's what i have. 2 different ways. not sure if it should be udp or not.
After sending FLAPON. it should send "1" back to the client.Code: Select all
<?php
$vbCrLf = chr(13) + chr(10);
$fp = fsockopen("udp://toc.oscar.aol.com", 5190, $errno, $errstr);
if (!$fp) {
echo "ERROR: $errno - $errstr<br />\n";
} else {
fwrite($fp, "FLAPON".vbCrLf.vbCrLf);
echo fread($fp, 26);
fclose($fp);
}
$fp = fsockopen("toc.oscar.aol.com", 5190, $errno, $errstr, 30);
if (!$fp)
{
echo "$errstr ($errno)<br>";
}
else
{
fwrite($fp, "FLAPON".vbCrLf.vbCrLf);
while (!feof ($fp))
{
$buffer = fgets($fp, 4096);
flush();
echo $buffer;
}
}
fclose ($fp);
?>feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]