Jump to content

Recommended Posts

Hey, I am getting this error when I compile my main .php file. The error says it is in xmlservbase.php at line 266

Here is what line 266 looks like......

$this->onConnect($this->clients[$i]);

 

And the only other file which has onConnect in it is Server.php and the bit with it in looks like this:

function onConnect($client){
	//$this->handleJoinRoom($this->getFreeRoom(), $client);
}

 

Thanks for helping, I am new too php!

here is the whole function of line 266

function addClient($data = null){
	if(Client::$num >= $this->config["MAX_CLIENTS"]){
		socket_close(socket_accept($this->mainSocket));
		return -1;
	}
	for ($i = 0; $i < $this->config["MAX_CLIENTS"]; $i++) {
		if (!isset($this->clients[$i])) {
			$this->clients[$i] = new Client(socket_accept($this->mainSocket), $this, $i);
			socket_set_nonblock($this->clients[$i]->sock);
			//socket_set_option($this->clients[$i]->sock, SOL_SOCKET, SO_LINGER, 4);//Wait 4 seconds before closing a socket(After close)
			socket_set_option($this->clients[$i]->sock, SOL_SOCKET, SO_REUSEADDR, 1);//Allow address reuse
			$this->sendPolicyFile($this->clients[$i]);
			266 here.$this->onConnect($this->clients[$i]);
			return 0;
		}
	}
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.