In one of our client-server application, we need to test the behavior of application when socket connections are lost due to various reasons. For this test, we need to simulate a program that can forcefully break the connections on a specific port on server every few seconds. This way we can test the behavior of how the connected clients react to such connection breakages.
Please suggest me if I can do this in my code or I can use this with any free software.
EDIT: We know the port at which we need to block connections for few milliseconds or seconds.
A daunting task!
First, grab the Microsoft Robotics SDK
Next, you'll need a programmable robot arm kit - there are a few of them reviewed here that look promising.
Now the tricky part - you'll need to code a series of actions that move the arm into position, close the hand (thus depressing the RJ45 release nubbin), then move laterally, so as to create an unplug/replug motion.
Once complete, position your robotic arm behind your system near the NIC ethernet port and call your methods to trigger the sequence!
Assuming you are on Windows
NetStat Agent has a trial version where you can monitor connections and kill them automatically based on filter. Also you can kill them manually. The one thing it can not do is setup some delay before killing connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With