[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] PHP-Novice, PING??



On Mon, Oct 5, 2009 at 4:32 PM, Peter Makholm <sslug@sslug> wrote:

> Søren Sørensen <sslug@sslug> writes:
>
> >   echo "making socket<br>";
> >  $socket = socket_create(AF_INET, SOCK_STREAM, 1);
> >  echo "Trying to connect<br>";
> >  $result=socket_connect($socket, "127.0.0.1", 22);
> >  echo "resultat: ".$result;
> >  echo "<br>reading<br>";
> >  if (socket_read($socket, 255))
> >   {
> >   echo "Got something<br>";
> >   }
>
> Nu kender jeg intet til PHP, men hvis socket_read laver blocking-IO så
> forsøger den muligvis at læse 255 bytes før den returnerer og så lang
> er et ssh-banner ikke.
>
> Prøv at nøjes med at læse 3 tegn istedet.
>
> //Makholm
>
Er nu prøvet, men det nyttede heller ikke. Det er den socket_connect der
driller, for den ville garanteret skrive et eller andet som $result hvis der
kom svar.

Mit problem er også at jeg kender meget lidt til PHP, men jeg regnede med at
ekspertertisen var at finde her på listen.

// Søren


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2009-11-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *