Re: [PHP-DEV] Stream: Cast and Seek

2009-12-05 Thread Arnaud Le Blanc
Hi,

Le samedi 05 décembre 2009 à 00:01 +0100, Samuel ROZE a écrit :
 Hello,
 
 I'm working on the use of a PHP SSH2 Stream returned by ssh2_shell
 function with stream_select() function. Within the PHP code, before
 being used into the select() C function, a stream have to be casted...
 The problem is that I don't really know what is it and how it generally
 works.
 
 So, can someone explain to me what means cast and seek streams ?
 
 (In fact, I have to cast a php_ssh2_channel_stream)

Here you need to return the underlaying socket on which the ssh session
is established, so that the OS's select() can work on it. Look at
php_openssl_sockop_cast for an example.

Regards,

Arnaud

 
 Thanks a lot.
 Regards,
 Samuel ROZE.
 
 
 


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Stream: Cast and Seek

2009-12-05 Thread Samuel ROZE
Thanks for you reply ! :-)
I think that my cast isn't very good because I've:

Warning: stream_select(): You MUST recompile PHP with a larger value of 
FD_SETSIZE.
It is set to 1024, but you have descriptors numbered at least as high as 
1728763902.
 --enable-fd-setsize=1728763904 is recommended, but you may want to set it
to equal the maximum number of open files supported by your system,
in order to avoid seeing this error again at a later date. in ...

That my cast code (patch on PHP 5.3 branche):
http://www.d-sites.com/wp-content/uploads/2009/12/cast_ssh2_stream.patch

Is there something wrong ?

Regards,
Samuel.

Le samedi 05 décembre 2009 à 13:40 +0100, Arnaud Le Blanc a écrit :
 Hi,
 
 Le samedi 05 décembre 2009 à 00:01 +0100, Samuel ROZE a écrit :
  Hello,
  
  I'm working on the use of a PHP SSH2 Stream returned by ssh2_shell
  function with stream_select() function. Within the PHP code, before
  being used into the select() C function, a stream have to be casted...
  The problem is that I don't really know what is it and how it generally
  works.
  
  So, can someone explain to me what means cast and seek streams ?
  
  (In fact, I have to cast a php_ssh2_channel_stream)
 
 Here you need to return the underlaying socket on which the ssh session
 is established, so that the OS's select() can work on it. Look at
 php_openssl_sockop_cast for an example.
 
 Regards,
 
 Arnaud
 
  
  Thanks a lot.
  Regards,
  Samuel ROZE.
  
  
  
 



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Stream: Cast and Seek

2009-12-05 Thread Arnaud Le Blanc
Le samedi 05 décembre 2009 à 18:00 +0100, Samuel ROZE a écrit :
 Thanks for you reply ! :-)
 I think that my cast isn't very good because I've:
 
 Warning: stream_select(): You MUST recompile PHP with a larger value of 
 FD_SETSIZE.
 It is set to 1024, but you have descriptors numbered at least as high as 
 1728763902.
  --enable-fd-setsize=1728763904 is recommended, but you may want to set it
 to equal the maximum number of open files supported by your system,
 in order to avoid seeing this error again at a later date. in ...

Check if stream-abstract is a php_ssh2_session_data (looks like it may
be a _channel_data instead).

 
 That my cast code (patch on PHP 5.3 branche):
 http://www.d-sites.com/wp-content/uploads/2009/12/cast_ssh2_stream.patch
 
 Is there something wrong ?
 
 Regards,
 Samuel.
 
 Le samedi 05 décembre 2009 à 13:40 +0100, Arnaud Le Blanc a écrit :
  Hi,
  
  Le samedi 05 décembre 2009 à 00:01 +0100, Samuel ROZE a écrit :
   Hello,
   
   I'm working on the use of a PHP SSH2 Stream returned by ssh2_shell
   function with stream_select() function. Within the PHP code, before
   being used into the select() C function, a stream have to be casted...
   The problem is that I don't really know what is it and how it generally
   works.
   
   So, can someone explain to me what means cast and seek streams ?
   
   (In fact, I have to cast a php_ssh2_channel_stream)
  
  Here you need to return the underlaying socket on which the ssh session
  is established, so that the OS's select() can work on it. Look at
  php_openssl_sockop_cast for an example.
  
  Regards,
  
  Arnaud
  
   
   Thanks a lot.
   Regards,
   Samuel ROZE.
   
   
   
  
 
 


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Stream: Cast and Seek

2009-12-04 Thread Samuel ROZE
Hello,

I'm working on the use of a PHP SSH2 Stream returned by ssh2_shell
function with stream_select() function. Within the PHP code, before
being used into the select() C function, a stream have to be casted...
The problem is that I don't really know what is it and how it generally
works.

So, can someone explain to me what means cast and seek streams ?

(In fact, I have to cast a php_ssh2_channel_stream)

Thanks a lot.
Regards,
Samuel ROZE.



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php