PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > with SSH2 persistent connection in php
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
with SSH2 persistent connection in php

Réponse
 
LinkBack Outils de la discussion
Vieux 11/04/2008, 14h14   #1
Rodrigo Reis da Rocha
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut with SSH2 persistent connection in php

Hi,
I want to make an persistent connection via ssh2 to a server with php, but
all I can get with the present API is an temporary connection that is lost
at end of the script.
Anyone have an idea of how I can save the Resource and reuse it on future
scripts instead of having to reconnect over and over again?

Thanks,
Rodrigo.

  Réponse avec citation
Vieux 11/04/2008, 14h45   #2
Jason Norwood-Young
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] with SSH2 persistent connection in php

On Fri, 2008-04-11 at 10:14 -0300, Rodrigo Reis da Rocha wrote:
> I want to make an persistent connection via ssh2 to a server with php, but
> all I can get with the present API is an temporary connection that is lost
> at end of the script.
> Anyone have an idea of how I can save the Resource and reuse it on future
> scripts instead of having to reconnect over and over again?


Hi Rodrigo

I recently did a little app that maintained persistent connections to a
XMPP server - a similar solution should apply to your problem.

I built a memory-resident app in the middle that received a unique ID
from my PHP page (you could use session_id for instance), assigned that
ID to a connection and created a permanent connection. It also queued
incoming messages so that when the PHP script connected again, it could
send through the queued messages, so that the end-user didn't miss
anything.

Initially I tried using PHP-cli for the memory-resident app but
eventually settled on Twistd Python because it was better at running
resident and handling multiple connections from different users without
blocking anything. On the front-end I used PHP and Ajax to give a
feeling of a "live" connection.

J

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h34.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07158 seconds with 10 queries