HELP: How can I timeout a TCP Client?

  • Thread starter Thread starter Matthew Speed
  • Start date Start date
M

Matthew Speed

I have written a TCP/IP server and a program to monitor whether the
server is running. To determine whether or not the server is running
I simply attempt to connect to the port on which the server listens
and jump out to a Catch block if the connection fails. I have
discovered that there are times when the server is still listening but
is unable to respond. I would then like to modify the server monitor
as follows:
Connect to the server. If no response, exit to Catch block and take
appropriate action. If the server does answer, send login
information. If server responds everything is okay. If the server
doesn't answer in 15 seconds (normal response time is immediate) then
assume server has failed and take appropriate action.

Any suggestions as to how to include a timer event inside the code
that is listening for a response from the server?

TIA
 
I'm not using a form, just a compiled module. The monitoring program
actually runs as a scheduled task and its purpose is to page me if the
server process goes down.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top