-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chrome.sockets.tcp implementation #178
Comments
You don't need 2 bytes for each char. The string's internal implementation will use two bytes to store each character in a binary string, but each character code is < 256 and when converting to a Uint8Array the number of bytes will match the number of characters. |
Wow. Yep. Sorry for bothering you. |
No problem! Glad that fixed it. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's how it looks:
socket.connect({
client.handshake();
})
tlsDataReady({
var data = connection.tlsData.getBytes();
var datab = str2ab(data);
socket.send(datab, function(writeInfo) {
});
})
socket.on("receive", function (msg) {
client.process(ab2str(msg.data));
});
How should I be converting the Data? Array Buffer <-> String data
[socket] connected
tlsDataReady ������������������������**utf characters**
[tls] server certificate verified
tlsDataReady utf characters
It just sits idle at this point...
The text was updated successfully, but these errors were encountered: