Jump to content

Archived

This topic is now archived and is closed to further replies.

lordphate

Probelm with sockets?

Recommended Posts

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=php:0] [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][/code]

Share this post


Link to post
Share on other sites

×

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.