java - Non-blocking write to a socket in Android -
i have android app has socket open. write socket without possibility of blocking thread on write noticeable amount of time. if io error occurs, write silently fail. there easy way this?
yes, nio provides socketchannel
class (call getchannel
method on socket
), allows call configureblocking
use non-blocking mode. should i/o through channel, , not through socket
object.
Comments
Post a Comment