Skip to content

feat: add connection read/write max bytes configuration option. - #113

Merged
jmglsn merged 1 commit into
stomp-php:masterfrom
ganeko:master
Nov 23, 2018
Merged

feat: add connection read/write max bytes configuration option.#113
jmglsn merged 1 commit into
stomp-php:masterfrom
ganeko:master

Conversation

@ganeko

@ganeko ganeko commented Nov 22, 2018

Copy link
Copy Markdown
Contributor

Based on previous discussion, #112

Added Connection read/write maximum bytes runtime configuration option in order to prevent any kind of problem with OpenSSL or others unpredictable services/components.

}

/**
* Set the maximum number of bytes to write to a resource

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comments of the 2 setter methods should describe why one would want that
e.g. that it seems to fix Amazon Queue

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will change with this for example:

    /**
     * Set the maximum number of bytes to write to a resource
     *
     * This will be useful if you are suffering problems with OpenSSL or Amazon MQ
     *
     * @param int $maxWriteBytes bytes
     */

It's ok for you?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, thx

$size = strlen($data);
$lastByteTime = microtime(true);
do {
$written = @fwrite($this->connection, substr($data, $offset), 81920);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we increase this buffer in this past?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really had reduced it, previously we trying to write all the message length at once. But still it seems that it was not enough.

@jmglsn
jmglsn merged commit ab88561 into stomp-php:master Nov 23, 2018
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.

3 participants