简体   繁体   English

带 Android 的套接字 Io

[英]Socket Io with Android

I am using this socket lib for implementation of chat App in Android socket chat .我正在使用这个套接字库在 Android套接字聊天中实现聊天应用程序。 i am using Emitter for sending messages and Listener for getting response.我正在使用 Emitter 发送消息和 Listener 来获取响应。 but i want to edit messages after sent messages to server.Is it possible in socket or not?但我想在将消息发送到服务器后编辑消息。是否可以在套接字中使用?

No its not possible by using socket.io emitter.不,使用 socket.io 发射器是不可能的。 Once you emit something and server receives then you cant change the emitted event.一旦你发出一些东西并且服务器接收到你就不能改变发出的事件。

Yes it is possible.对的,这是可能的。 Simply edit the object whenever it reaches server.只需在对象到达服务器时对其进行编辑即可。 From there u can do whatever you choose with the edited object, most likely that would be send it to its final destination.从那里你可以对编辑过的对象做任何你选择的事情,最有可能的是将它发送到它的最终目的地。 I assume this means you are using node js so knowledge of js is required.我认为这意味着您正在使用节点 js,因此需要了解 js。 You would edit the js object as seen in the link below.您将编辑 js 对象,如下面的链接所示。 Edit Object Item with Javascript 使用 Javascript 编辑对象项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM