GoogleChromeLabs / pywebsocket3

BSD 3-Clause "New" or "Revised" License
43 stars 32 forks source link

Support sending "array" types for binary data #10

Open ricea opened 4 years ago

ricea commented 4 years ago

Migrated from https://github.com/google/pywebsocket/issues/131:

What steps will reproduce the problem?
1. Construct an array using array.array()
2. Attempt to send it using request.ws_stream.send_message(message, binary=True)

Expected result:

Binary data is sent.

Actual result:

TypeError: web_socket_transfer_data raised exception for /flow-control-test: 
cannot concatenate 'str' and 'array.array' objects

Probably a TypeError would be appropriate if binary=False, but when binary=True 
this seems a natural way to send large binary objects.

Original issue reported on code.google.com by ri...@google.com on 10 Jul 2014 at 10:18

ricea commented 4 years ago

Since we've managed without this for a long time, and there's an easy workaround in the array.tobytes() method, this is very low priority.