Niklas Keller
0c059ba0e6
Suppress errors also for stream_socket_shutdown, relates to #32
2017-12-10 17:40:58 +01:00
Niklas Keller
c5e31aa7b7
Fix #32 : Suppress errors for feof, because pthreads
2017-12-10 17:36:05 +01:00
Niklas Keller
3c24903849
Use fread() for STDIO instead of stream_get_contents()
...
Turns out this fixes the issues with amphp/parallel on Windows.
2017-12-05 19:57:30 +01:00
Bob Weinand
0f501deb7c
Fix #29 - do not release resource on __destruct()
...
This ensures getResource() still returning a valid resource during cyclic garbage collection
2017-10-17 03:50:40 +02:00
Niklas Keller
d60ba033c4
Use stream_get_contents instead of fread for ResourceInputStream
...
This fixes an issue with TLS streams: https://github.com/amphp/artax/issues/138 .
We still use for UDP, because stream_get_contents might read multiple packages there if I'm not mistaken.
2017-10-08 12:38:01 +02:00
Fabien Villepinte
0dff1fe859
Anonymous function has an unused use $resource
2017-10-01 12:04:51 +02:00
Bob Weinand
a70a650793
Also \assert() against fclose() instead of silently returning null
2017-07-15 10:38:47 +02:00
Niklas Keller
704adf70cf
Add reference and unreference methods to ResourceInputStream
2017-06-23 16:33:13 +02:00
Niklas Keller
b67358ad91
Suppress errors on close for resource streams
...
A resource might still be non-null, but already closed.
2017-06-19 08:43:07 +02:00
Aaron Piotrowski
48c4e122d8
Tweak closing
...
Resource is not nulled in watcher callback if reading/writing fails so close() will still call shutdown/fclose.
2017-06-18 23:14:59 -05:00
Niklas Keller
8d74c85048
Apply same closing mechanism to RIS
2017-06-18 23:25:22 +02:00
Niklas Keller
93540890fd
Remove unnecessary isset check for stream modes
2017-06-18 22:55:44 +02:00
Niklas Keller
8b20bf90b8
Fix feof check
2017-06-17 17:46:18 +02:00
Niklas Keller
2ecbf8aa8b
Respect chunk size for ResourceOutputStream, document resource streams
2017-05-25 18:12:12 +02:00
Niklas Keller
eb9394a5da
Make resource streams final
2017-05-22 14:38:39 +02:00
Aaron Piotrowski
ca3ab2dc73
Restore destructor on resource stream
...
Forgot close() needed to be called to free watcher.
2017-05-12 10:27:58 -05:00
Aaron Piotrowski
e7f7326363
PendingReadException → PendingReadError
...
Consecutive reads is a coding error, so it should be an instance of Error.
2017-05-12 00:06:07 -05:00
Aaron Piotrowski
f6e765cea3
Succeed reads with null on closed stream
2017-05-11 23:56:36 -05:00
Aaron Piotrowski
c2eac67b79
Fix close() and make public again
2017-05-11 23:52:15 -05:00
Aaron Piotrowski
cfbf25e3b5
Remove close() from interfaces
2017-05-11 18:08:45 -05:00
Niklas Keller
55a7118da9
Add .editorconfig and fix code style
2017-05-07 22:14:45 +02:00
Niklas Keller
73e6441fd9
Add getResource() to resource streams
2017-05-05 16:45:53 +02:00
Aaron Piotrowski
4b7a537d7b
Refactor ResourceInputStream for new API
2017-05-04 16:30:40 -05:00
Niklas Keller
bf90335bb6
Major API change + merged Reader and Writer from amphp/socket
2017-04-30 08:33:16 +02:00