Exemplo n.º 1
0
 public void BasicGetSetInfoDefaults()
 {
     using (var handle = MailslotMethods.CreateMailslot(@"\\?\mailslot\basicgetsetinfodefaultstest"))
     {
         handle.IsInvalid.Should().BeFalse();
         var info = MailslotMethods.GetMailslotInfo(handle);
         info.MessageCount.Should().Be(0);
         info.NextSize.Should().Be(uint.MaxValue);
         info.MaxMessageSize.Should().Be(0);
         info.ReadTimeout.Should().Be(0);
         MailslotMethods.SetMailslotTimeout(handle, 100);
         MailslotMethods.GetMailslotInfo(handle).ReadTimeout.Should().Be(100);
     }
 }
Exemplo n.º 2
0
 public void BasicGetInfo()
 {
     using (var handle = MailslotMethods.CreateMailslot(
                name: @"\\?\mailslot\basicgetinfotest",
                maxMessageSize: 256,
                readTimeout: 1000))
     {
         handle.IsInvalid.Should().BeFalse();
         var info = MailslotMethods.GetMailslotInfo(handle);
         info.MessageCount.Should().Be(0);
         info.NextSize.Should().Be(uint.MaxValue);
         info.MaxMessageSize.Should().Be(256);
         info.ReadTimeout.Should().Be(1000);
     }
 }