EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Emulate timeout condition

Posted: 04/03/2015 09:45:37
by Leonardo Herrera (Standard support level)
Joined: 02/14/2011
Posts: 67


Is there an easy way to simulate a timeout receiving the answer from a server, without using a fake or mock server?

As explained in a different question(*), sometimes my application get timeout after sending some important data. I would like to test my solution, but the prospect to set up a mock server is daunting and I'm afraid my code is not really well decoupled at this point. Can I emulate a timeout condition without manipulating the server, using some temporary code perhaps?

(*): https://www.eldos.com/forum/read.php?FID=7&TID=5906
Posted: 04/03/2015 16:03:16
by Ken Ivanov (Team)


As an option, you might consider setting SocketTimeout to some really small value (but not 0) - e.g. 5 or 10 milliseconds - and running the test against the real server. Unless your server is located in the same network and/or is really fast, it is unlikely that it will manage to serve the request within such a short time period.




Topic viewed 597 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!