Git Product home page Git Product logo

Comments (10)

lemunozm avatar lemunozm commented on July 17, 2024 1

If the server can interpret the binary message correctly, then that can be a workaround, yes

from message-io.

hschneider avatar hschneider commented on July 17, 2024 1

It sends and receives unicode perfectly. So I see no problem even not at the server's side. Assumed, the server does not await plain text messages :-/

from message-io.

lemunozm avatar lemunozm commented on July 17, 2024

Hi @reison1218 , I'm glad you like it!

Because we need a "common" interface for all adapters, WS works in binary mode. Nevertheless, once #54 was merged (thanks to @kgraefe), I think this capability for WS can be allowed through configuration. Something like:

let conn = handler.network().connect_with(TransportConnect::Ws(WsMode::Text), addr)?;

The interface of the adapter will be the same, but the &[u8] parameters can now be interpreted internally as text, and internally the Ws adapter will send/receive the data as text.

from message-io.

reison1218 avatar reison1218 commented on July 17, 2024

thanks for your reply.
i have check the #54
so,if merge it.
we can code like this?

handler.network().listen(Transport::Ws(WsMode::Message), "0.0.0.0:3044").unwrap();

why the WsMode is Message?because user can process Text and Binary both.not just one of them.

does it possible?

from message-io.

lemunozm avatar lemunozm commented on July 17, 2024

Respecting the current interface, you need to choose between one of them when creating the connection, because send()/recv() methods only knows about the buffer. You do not have enough information to know how to interpret what that buffer has

from message-io.

reison1218 avatar reison1218 commented on July 17, 2024

thanks for answer : )

from message-io.

lemunozm avatar lemunozm commented on July 17, 2024

Given another thought on this, maybe we could have another send_with() and recv_with() that allows to pass specific transport properties, following the structure found un #54 i.e:

send_with(data, TransportProp::Ws(WsMode::Text))

from message-io.

hschneider avatar hschneider commented on July 17, 2024

Is there currently a way to receive and send text-messages or is it still work in progress?

from message-io.

lemunozm avatar lemunozm commented on July 17, 2024

There is no way to send text messages right now. I'm still open to review a PR with the required changes or discussing an idea. But I'm no longer adding new features in message-io, at least by now.

from message-io.

hschneider avatar hschneider commented on July 17, 2024

OK - thanks for the info.

So converting bin to text and vice versa should do as a temp. workaround. This is something every end-user should be able to do.

from message-io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.