public void socket_is_pinged_when_no_data_has_been_read_during_interval()
{
var buffer = new byte[1];
var pingWindow = TimeSpan.FromMilliseconds(5);
using(var context = CreateTestContext())
{
Action read = () =>
{
context.Stream.Fill(buffer, 0, buffer.Length);
};
read.BeginInvoke(null, null);
for(int i = 0; i < 10; ++i)
{
Thread.Sleep(context.Stream.PingInterval);
Assert.Equal(1, context.Remote.Receive(buffer));
Assert.Equal(0, context.Remote.Available);
}
}
}