From the node.js server
const binaryData = new Uint8Array([1, 2, 3, 4, 5]);
socket.emit('message_test', binaryData.buffer);
console.log('Send packet');
I sent the packet to the client in this way
The client side using the socket.io library is not receiving packets.
bool packet::is_binary_message(string const& payload_ptr)
{
return payload_ptr.size()>0 && payload_ptr[0] == frame_message;
}
It is not recognized as a binary here. When sending using the socket.io library in node.js, it is said that the frame_type value and the type value are internally recognized and distinguished without explicitly.
As a test, I put the frame_type value and the type value in front of the buffer, and the client was able to receive the packet. What is the cause of the problem? Please help
I’ve tried this and that, but I don’t know. Please help
문성현 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.