• No replies
210 Posts

Pinned topic Time taken to open a socket is very high

‏2006-10-27T10:32:05Z |
sock = new Socket(hostName, portNo);
But it takes a lot of time??(even 4 to 5 seconds)
Is there any other way so that the statement is executed quickly.

I do this to test whether the service is running on the host machine or not.I calculate the response time by the difference of the opening and closing time of the socket.Since the time for opening and closing the socket is very high.response time is very high.Is ther any to free the sockets before opening them or any other method to be executed.
Please help.Looking forward to your reply