Parameter must be passed by reference
2 posts
• Page 1 of 1
Parameter must be passed by reference
Hello, I've just begun trying Phalanger 2.0b2, and really like what I see.
However, when I try using the sockets extension, I get the following error when trying to call socket_select():
Error: Parameter '1' must be passed by reference in <script> at expression on line 29, column 5.
Any kind of help would be appreciated. Or is it a bug?
The script looks like this (basic only):
<?php
$address = '127.0.0.1';
$port = 6502;
$max_clients = 1;
// Set time limit to indefinite execution
settimelimit (0);
// Create a TCP Stream socket
$sock = socketcreate(AFINET, SOCK_STREAM, 0);
// Bind the socket to an address/port
socket_bind($sock, $address, $port) or die('Could not bind to address');
// Start listening for connections
socket_listen($sock);
// Loop continuously
$read = $client = array();
while (true) {
// Setup clients listen socket for reading
$read0 = $sock;
for ($i = 0; $i < $max_clients; $i++) {
if (@$client$i'sock' != null) $read$i + 1 = $client$i'sock';
}
// Set up a blocking call to socket_select()
$write = $except = $tv = null;
$ready = socket_select($read, $write, $except, $tv);
}
?>
And the config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<phpNet>
<classLibrary>
<add assembly="php_sockets.mng, Version=2.0.0.0, Culture=neutral, PublicKeyToken=4ef6ed87c53048a3" section="sockets" />
</classLibrary>
<sockets>
<!-- Use the system read() function instead of the php_read() wrapper. -->
<set name="sockets.usesystemread" value="On" />
</sockets>
</phpNet>
</configuration>
However, when I try using the sockets extension, I get the following error when trying to call socket_select():
Error: Parameter '1' must be passed by reference in <script> at expression on line 29, column 5.
Any kind of help would be appreciated. Or is it a bug?
The script looks like this (basic only):
<?php
$address = '127.0.0.1';
$port = 6502;
$max_clients = 1;
// Set time limit to indefinite execution
settimelimit (0);
// Create a TCP Stream socket
$sock = socketcreate(AFINET, SOCK_STREAM, 0);
// Bind the socket to an address/port
socket_bind($sock, $address, $port) or die('Could not bind to address');
// Start listening for connections
socket_listen($sock);
// Loop continuously
$read = $client = array();
while (true) {
// Setup clients listen socket for reading
$read0 = $sock;
for ($i = 0; $i < $max_clients; $i++) {
if (@$client$i'sock' != null) $read$i + 1 = $client$i'sock';
}
// Set up a blocking call to socket_select()
$write = $except = $tv = null;
$ready = socket_select($read, $write, $except, $tv);
}
?>
And the config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<phpNet>
<classLibrary>
<add assembly="php_sockets.mng, Version=2.0.0.0, Culture=neutral, PublicKeyToken=4ef6ed87c53048a3" section="sockets" />
</classLibrary>
<sockets>
<!-- Use the system read() function instead of the php_read() wrapper. -->
<set name="sockets.usesystemread" value="On" />
</sockets>
</phpNet>
</configuration>
- cariad@codeplex
- Posts: 1
- Joined: January 7th, 2012, 8:58 pm
RE: Parameter must be passed by reference
This discussion has been copied to Work Item 1969. You may wish to continue further discussion there.
- Tomas Matousek
- Posts: 17
- Joined: January 7th, 2012, 8:52 pm
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 22 guests