All pastes #32245 Raw Edit

h3

public php v1 · immutable
#32245 ·published 2005-12-03 19:12 UTC
rendered paste body
	function mainloop() {		#$x=0;		$this->eventLog('Logged in.. now listening for events.',0);		while (true) {			/*			* @todo: find optimal byte read			*/			while ($this->stream = socket_read($this->socket,1024)) {				if($this->capturePacket==1) {					$this->packet .= $this->stream;					if(stristr($this->stream,rn.rn)) {						$this->throwEvent();						$this->packet = '';					}				} else {					if(stristr($this->stream,'Event:')) {						$this->eventLog('Incoming event.',0);						$this->capturePacket = 1;						$this->packet .= $this->stream;					} else { /* may not be necessary .. */					$this->packet = '';					}				}			}		}	}