test
PHP Sockets/Class Error
Page 1 of 1 [ 2 posts ]
Code:
ircservices@LXS-SC1:~$ php server.php
Fatal error: Only variables can be passed by reference in /home/ircservices/server.php on line 57
ircservices@LXS-SC1:~$ vi +57 server.php
Fatal error: Only variables can be passed by reference in /home/ircservices/server.php on line 57
ircservices@LXS-SC1:~$ vi +57 server.php
Next couple of lines is just here to give you a little idea of whats going on
Code:
for($i=0; $i < $config['max-conns']; $i++){
if($this->client[$i]['sock'] != null){
$this->read[$i+1]=$this->client[$i]['sock'];
}
}
}
/* Connecting User */
function connecting($config){
$read=$this->read;
if($this->client[$i]['sock'] != null){
$this->read[$i+1]=$this->client[$i]['sock'];
}
}
}
/* Connecting User */
function connecting($config){
$read=$this->read;
And this is the line that's causing the error
Code:
$ready=socket_select($read,null,null,null);
And more stuff
Code:
/* Add Client */
if(in_array($this->sock, $this->read)){
for($i=0; $i < $config['max-conns']; $i++){
if($this->client[$i]['sock']==null){
$this->client[$i]['sock']=socket_accept($this->socket);
echo '[CONNECT] New client connected\n';
break;
}elseif($i==$config['max-conns']-1){
if(in_array($this->sock, $this->read)){
for($i=0; $i < $config['max-conns']; $i++){
if($this->client[$i]['sock']==null){
$this->client[$i]['sock']=socket_accept($this->socket);
echo '[CONNECT] New client connected\n';
break;
}elseif($i==$config['max-conns']-1){
Any idea how I can fix this (stupid) error?
Page 1 of 1 [ 2 posts ]
| Similar Topics | |
|---|---|
| Why do sockets look sad instead of happy? |
27 Jul 2009, 6:08 am |
| Class Size for an Autism Specific Class - Survey |
21 Dec 2010, 1:37 pm |
| Friendship class or Social Skills class - do they help? |
08 Mar 2011, 10:31 pm |
| Canadian middle class wealthier than American middle class |
04 May 2014, 7:51 am |
