简体   繁体   English

客户端套接字监听器(Android)

[英]Listener to socket at client(Android)

I want to have a listener for a socket at the client side. 我想在客户端有一个套接字监听器。 I am using Android which is Java. 我正在使用Java的Android。 I am using TCP/IP but I don't want to loop at the client side. 我正在使用TCP / IP,但我不想在客户端循环。

Is there any method for that or do I have to have my own mechanism for listening? 有什么方法吗?还是我必须有自己的监听机制?

Any help would be appreciated. 任何帮助,将不胜感激。 Thanks, 谢谢,

Android being Java, you will have to open a new Thread if you want to do asynchronous processing of the incoming data. Android是Java,如果要对传入数据进行异步处理,则必须打开一个新Thread Be careful to synchronize all communications between the threads properly. 请注意正确同步线程之间的所有通信。

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

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