Call Thread.sleep(1000)
in the run method of the SocketProcessor
.
The method wait
is not the right one to call for your purpose.
See also:
The methods wait
, notify
, notifyAll
are defined on java.lang.Object
and are used for synchronization between threads. They are not generally
for the purpose of making a thread sleep for a certain amount of time.