java - Having a listener thread in a client -
i have client sever program need client able listen messages sever may send @ time. need client send information when needed to. best way this? understand i'd need thread.
any appreciated.
if thing client do, don't need separate thread.
otherwise, yes, need 1 background thread handle these tasks would
free main thread other things.
to create thread, basic way extend thread
or implement runnable
.
see also:
http://docs.oracle.com/javase/tutorial/essential/concurrency/
Comments
Post a Comment