Both the writer and reader code will catch the "socket exception" thrown when mdsd exits/crashes, but the plug-in can't recover from that situation. When the plug-in is configured to queue writes (letting them be handled by the resender thread), the fix isn't overly complicated:
Kill the reader and resender threads
Start a new thread to reconnect
When that succeeds, restart the reader and resender threads with the new connection
If the plug-in is configured for direct writes without the resender thread, recovery may involve turning on queue-for-resend to avoid data loss.
Both the writer and reader code will catch the "socket exception" thrown when mdsd exits/crashes, but the plug-in can't recover from that situation. When the plug-in is configured to queue writes (letting them be handled by the resender thread), the fix isn't overly complicated:
If the plug-in is configured for direct writes without the resender thread, recovery may involve turning on queue-for-resend to avoid data loss.