EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Emulate timeout condition

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
Posted: 04/03/2015 09:45:37
by Leonardo Herrera (Standard support level)
Joined: 02/14/2011
Posts: 66


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 (EldoS Corp.)


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 496 times

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


Back to top

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

Got it!