Ignore:
Timestamp:
03/11/08 14:53:31 (17 years ago)
Author:
niltonneto
Message:

Correções do módulo instant_messenger.
Ver WiKi? em: http://www.expressolivre.org/dev/wiki/messenger

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/instant_messenger/inc/class.Ujabber.inc.php

    r164 r216  
    2626        { 
    2727                $this->closeSocket(); 
     28                ob_end_flush(); 
     29                flush(); 
     30        } 
     31         
     32        public final function isConnected() 
     33        { 
     34                return $this->connected; 
    2835        } 
    2936         
    3037        public final function listen() 
    3138        { 
    32                 if ( !$this->connected ) 
     39                if ( !$this->isConnected() ) 
    3340                        return "disconnected"; 
    3441 
     
    4754                        $init = time(); 
    4855 
    49                         while ( !connection_aborted() && time() - $init < 30 ) 
     56                        while ( !connection_aborted() && time() - $init < 50 ) 
    5057                        { 
    5158                                # read from server and write in the client 
    5259                                $xml = $this->readSocket(); 
     60                                //var_dump($xml); 
    5361                                $xml = ( strlen($xml) ) ? $xml : ' '; 
    5462                                printf("%s", $xml); 
     
    5765                                usleep(6000); 
    5866                        } 
    59                         ob_end_flush(); 
    6067                } 
    6168        } 
     
    6370        public final function SendMessage($pSendMessage) 
    6471        { 
     72                if ( !$this->isConnected() ) 
     73                        return "disconnected"; 
     74 
    6575                $pSendMessage['body'] = stripslashes($pSendMessage['body']); 
    6676 
Note: See TracChangeset for help on using the changeset viewer.