After a bit more searching, I was able to find out how to access the Socket from the TcpClient. After I had this, I was able to use Poll to confirm the connection was still open. My code is below:
try
{
if (client.Client.Poll(1000, SelectMode.SelectRead) && client.Client.Available == 0)
{
isConnected = false;
}
}
catch (Exception)
{
// If an exception is thrown, then the connection is closed
isConnected = false;
}
Client.Poll returns true if the connection is closed, reset, terminated, pending, or there is data available. If you check Client.Available, and there is no data, then the connection must be closed. This is not foolproof, but works for my purposes, since I just go back to listening.
This solution came from zendar, and is located here.