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

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -