How to make an existing socket fail?
Posted
by Huckphin
on Stack Overflow
See other posts from Stack Overflow
or by Huckphin
Published on 2010-06-07T23:40:05Z
Indexed on
2010/06/07
23:52 UTC
Read the original article
Hit count: 366
OK. So, this is exactly the opposite of what everyone asks about in network programming. Usually, people ask how to make a broken socket work. I, on the other hand am looking for the opposite.
I currently have sockets working fine, and want them to break to re-create this problem we are seeing. I am not sure how to go about intentionally making the socket fail by having a bad read. The trick is this: The socket needs to be a working, established connection, and then it must fail for whatever reason.
I'm writing this in C and the drivers are running on a Linux system. The sockets are handled by a non-IP Level 3 protocol in Linux by a Linux Device Driver. I have full access to all of the code-base, I just need to find a way to tease it out so that it can fail.
Any ideas?
© Stack Overflow or respective owner