I am writing an application to connect to a third-party application using REST web services.
I have a configuration page that asks for an IP address, port, username and password, currently it just blindly assumes that you are entering the correct data and trying to establish a connection.
I want to create a test procedure that goes through and performs the following steps when setting up configuration information
- Is the IP / Hostname specified correctly (using ping or something else)
- Is the port used correctly?
- Is the username and password correct?
then displays the results on the screen along the way, so if he cannot connect to the service, it is easier to determine where the problem is.
To complete step 1, I would like to use Ping or some equivalent, which does not depend on which port is open. Therefore, I can exclude dodgy DNS or typo in IP / Hostname.
From the previous questions, I understand that ping failed in 7.0, but socket classes were added with Mango, is this possible now, if so, how? If this is not yet possible, is there another way I can achieve step 1?
Matt source
share