Saturday, February 1, 2014

TCP/IP Reconnect feature

Hi All,


In my application, i want reconnect a feature for a TCP/IP socket connection. I mean once user clicks connect if the client doesnt get connected in some interval (say timeoutInterval = 3 seconds) then it should discard the connect operation and try connecting again. This reconnection opertaion should be carried out 3 times. After 3 attempts if client cant establish connection then it should inform user with an error message.


The problem is with respect to the timeout value after client starts trying connection. I mean when client calls 'Connect' method it may take some time to connect to the server. if this time exceeds the predefined timeout value (say 3 seconds) then client should stop/abort connect operation.


And then again it can try connecting where i will use the retry count. How to handle this timeout condition for client socket connection.


Thanks,


IamHuM


No comments:

Post a Comment