I have already written a request-method in java that sends a request to a simple Server. I have written this simple server and the Connection is based on sockets. When the server has the answer for the request, it will send it automatically to client. Now I want to write a new method that can behave as following:

**if the server does not answer after a fixed period of time, then I send a new Request to the server using my request-method**

My problem is to implement this idea. I am thinking in launching a thread, whenever the request-method is executed. If this thread does not hear something for fixed period of time, then the request method should be executed again. But how can I hear from the same socket used between that client and server?

I am also asking,if there is a simpler method that does not use threads

curently I am working on this idea
 I am working on this idea:

```
1)send a request using my request-method
2)launch a thread for hearing from socket
3)If(no answer){   go to (1)}
  else{
      exit
  }

```

I have some difficulties in step 3. How I can go to (1)