-
Notifications
You must be signed in to change notification settings - Fork 501
Unable to store Stream resources in Thread object #39
Comments
snapshots waiting for testing @ http://pthreads.org/snapshots |
Thx for trying to fix this, unfortunately the fix seams to be incomplete in 2e4f64b The following example still fails in the same way. <?php
class Work extends Stackable {
public function run(){
}
}
class Test extends Thread {
public function run(){
$test = new Work();
$this->test = $test;
print_r($this->test);
var_dump($this->test);
$stream = fopen("d:\\test.txt", "w+");
var_dump($stream);
$this->stream = $stream;
fwrite($this->stream, "test");
fwrite($this->stream, "test");
fwrite($this->stream, "test");
var_dump($this->stream);
}
}
$test =new Test();
$test->start();
?> |
:) |
Helllo i have the same Problem on php5-5.4.20 with pthreads 2.0.10 class Joy {
} class Test extends Thread {
} $test =new Test(); stream is NULL when using this. Best Regards |
In passing I noticed the examples here are messing with blocking flags on filesystem resources. As a public service announcement:
Here's a good read on the subject: |
Hello BR/Torsten |
As soon as I assign a stream resource to a thread object member the stream resource gets somehow damaged.
error message is:
Warning: stream_set_timeout(): 2 is not a valid stream resource in P:\php\test.php on line 6
Using PHP 5.4, pthreads [245dbb1] on windows
If I change $this->socket to $stream it works fine.Also if I reverse the order of the "steam_set_blocking" and the "stream_set_timeout the error happens on the stream_set_blocking command and if I add a print_r($this->socket) before the steam_set_ it happens on both.
Any idea?
EDIT: I can confirm the same problem also happening with Stackable objects (instread Thread), while it works if using global scope
The text was updated successfully, but these errors were encountered: