uperl / AnyEvent-WebSocket-Client

WebSocket client for AnyEvent
9 stars 10 forks source link

Extend close method to accept optional close codes and reason #23

Closed jjatria closed 8 years ago

jjatria commented 8 years ago

This pull request adds the possibility of explicitly stating a close code and reason as stated in RFC6455 §5.5.1 and §7.4.1.

I think these changes should be backwards compatible, since calling close with an empty list defaults to 1005, which was the code I was receiving. If this is not the case, then I can change it so backwards compatibility is kept.

plicease commented 8 years ago

As mentioned in #7 if you can add a non-mojo version of the test that would be good.

plicease commented 8 years ago

I've merged your changes, and added documentation for the new arguments. I modified your original commit so that it didn't include the whitespace changes because they made it confusing to review. I will be doing a dev release shortly, followed in a couple of days by a production release.

If you want to write an extra test that is cool, but if you don't have time don't worry about it, I think it is more important to have the feature.

Thank you for contributing!

plicease commented 8 years ago

This is included in the production version 0.34 now on its way to CPAN.

jjatria commented 8 years ago

Thanks! I'll see if I manage to put together a non-Mojo test for this.

By the way, this will be my first contribution making its way to CPAN. Exciting times!