|There's more than one way to do things|
Dangerous method? Protocol::WebSocket::Frame::to_stringby Riales (Hermit)
|on May 30, 2013 at 06:54 UTC||Need Help??|
Riales has asked for the
wisdom of the Perl Monks concerning the following question:
I was using Protocol::WebSocket::Frame and noticed that if you try to use its to_string method, it dies with the message DO NOT USE.
Anybody know why? It looks like it fulfills a fairly benign function - it just wraps its current buffer with \x00 and \xff...
Also, anybody know the proper way to send a websocket message if not with the to_string method in this module?
Many thanks in advance!
EDIT: Figured out the proper way (or at least a way that works) - using the to_bytes method instead of the to_string method works beautifully. My vague guess is that it has something to do with encodings, but I would love if somebody that knew more would enlighten me.