简体   繁体   中英

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. I am using TCP/IP but I don't want to loop at the client side.

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. Be careful to synchronize all communications between the threads properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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