I am trying to do exactly what the subject says for a test case, meaning when doing the check if(socket.Connected)
you would get false, but the socket object remains and not get disposed. I know Polling test would be more precise but I'm not really interested in that for my current purpose of testing.
I looked around on this forum but I don't see a way to do this in C#, is this possible? I'm trying to create this scenario:
- Check Socket Connected, it fails.
- Reconnect socket so
Socket.Connected
return true. - Sleep or wait for a period of time.
- Set the
Socket.Connected
to false again.