1.5.60911.10中System.Net.Sockets.UdpClient主机名的合同不正确 [英] Incorrect contract for System.Net.Sockets.UdpClient hostname in 1.5.60911.10
问题描述
使用代码合同 1.5.60911.10我收到以下警告:
C:\PView \isip \ components \IheAudit\Audit\UdpSyslogAuditSubscriber.cs(54 ,17):警告:CodeContracts:require为false:hostname == null
在合同装配中查看dotPeek我看到:
public int Send(byte [] dgram,int bytes,string hostname,int port)
  {
    Contract.Requires(dgram!= null,(string)null," dgram!= null");
    Contract.Requires(hostname == null,(string)null," hostname == null");
    Contract.Requires(port == 0,(string)null," port == 0");
    int num;
   返回号码;
  }
似乎这个合同与实际实现和MSDN文档不一致。注意:其他发送重载似乎也包含某些参数的无效合约。
感谢报告!
我修复了合同。
f
With Code Contract 1.5.60911.10 I get the following warning:
C:\PView\isip\components\IheAudit\Audit\UdpSyslogAuditSubscriber.cs(54,17): warning : CodeContracts: requires is false: hostname == null
Looking with dotPeek in the contract assembly I see:
public int Send(byte[] dgram, int bytes, string hostname, int port)
{
Contract.Requires(dgram != null, (string) null, "dgram != null");
Contract.Requires(hostname == null, (string) null, "hostname == null");
Contract.Requires(port == 0, (string) null, "port == 0");
int num;
return num;
}
It seems that this contract is incorrect with the actual implementation and the MSDN documentation. Note: Other send overloads also seem to have invalid contracts for some of the arguments.
thanks for reporting it!
I fixed the contracts.
f
这篇关于1.5.60911.10中System.Net.Sockets.UdpClient主机名的合同不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!