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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -