Jump to content


Photo

Probelm with sockets?


  • Please log in to reply
No replies to this topic

#1 lordphate

lordphate
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 08 August 2006 - 07:52 PM

Warning: socket_read() unable to read from socket [104]: Connection reset by peer in /home/arshemn/public_html/library/whm.php on line 259
Connection Not Yet Established.

the code iss too long to post but here is 10 before and ten after
[code]               $result = socket_connect ($socket, $address, $service_port);

                if ($result < 0) {

                        $cpanelaccterr = "socket_connect() failed";

                        return;

                }

                $in = "GET $request HTTP/1.0\n";

                socket_write($socket,$in,strlen($in));

                $in = "Connection: close\n";

                socket_write($socket,$in,strlen($in));        

                $in = "Authorization: WHM $authstr\n\n\n";

                socket_write($socket,$in,strlen($in));

        

                $inheader = 1;

                while(($buf = socket_read($socket, 512)) !== false) {

                  if (!$inheader) {

                          $data .= $buf;

                  }

                  if(preg_match("'\r\n\r\n$'s", $buf)) {

                        $inheader = 0;

                  }[/code]





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users