Closed lingfan closed 3 years ago
Hi @lingfan
Websocket only uses the binary message type for communication. Probably I should clarify it in the documentation. As I have seen in the wstool
, the websocket message is sent in text mode and then discarded by message-io
.
The reason for using binary mode instead of text mode is that message-io is transport-independent and treats the message with the same level of information as UDP or TCP handle it, binary raw message. Is it on the user side how to interpret the message. In future versions of message-io
, you could parameterize transports to specify this kind of configuration, but for now, only binary websocket messages are interpreted as user data.
the binary is very good! thanks my test is running
http://www.easyswoole.com/wstool.html
the websocket server not revice data
let addr = SocketAddr::from(([0, 0, 0, 0], 65400)); let mut addrs_iter = addr.to_socket_addrs().unwrap();
let transport = Transport::Ws;
let addr1 = addrs_iter.next().unwrap(); server::run(transport, addr1);