Skip to content

Conversation

@timsmid
Copy link

@timsmid timsmid commented Jan 12, 2019

This PR improves the way the stream timeout is handled. More specifically:

  • The timeout is only set once during the creation of the stream. This is done through the setStreamTimeout method once the stream has been created.
  • The unnecessary try-catch block in setStreamTimeout is removed.
  • The number_format call for calculating the stream timeout is error-prone. It is replaced with int-casting and a call to round.
  • The stream_set_timeout emits a warning when float values are provided instead of ints. This solution ensures only ints are provided. The current solution and PR Fixes #129 Adding optional params to number_format #132 don't fully account for this situation.
  • Strange timeout values are denied. This for example includes negative values and values greater than PHP_INT_MAX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant