本文整理汇总了C#中Exchange.SendReject方法的典型用法代码示例。如果您正苦于以下问题:C# Exchange.SendReject方法的具体用法?C# Exchange.SendReject怎么用?C# Exchange.SendReject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exchange
的用法示例。
在下文中一共展示了Exchange.SendReject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeliverRequest
/// <inheritdoc/>
public void DeliverRequest(Exchange exchange)
{
exchange.SendReject();
}
示例2: if
void IMessageDeliverer.DeliverRequest(Exchange exchange)
{
Request request = exchange.Request;
TRequestType requestType = TRequestType.NotSet;
if (request.Method == Method.POST)
{
if (request.URI.AbsolutePath == "/rd")
{
if ((request.ContentType == (int)MediaType.ApplicationLinkFormat) || (request.ContentType == -1))
//if (request.ContentType == (int)MediaType.ApplicationLinkFormat)
{
requestType = TRequestType.Register;
}
}
}
if (request.URI.AbsolutePath.StartsWith("/rd/"))
{
if ((request.Method == Method.POST) || (request.Method == Method.PUT))
{
requestType = TRequestType.Update;
}
else if (request.Method == Method.DELETE)
{
requestType = TRequestType.Deregister;
}
}
if (requestType == TRequestType.NotSet)
{
exchange.SendReject();
}
else
{
AddRequest(requestType, exchange);
}
}
示例3: AddRequest
void IMessageDeliverer.DeliverRequest(Exchange exchange)
{
Request request = exchange.Request;
TRequestType requestType = TRequestType.NotSet;
if (request.Method == Method.POST)
{
if (request.URI.AbsolutePath == "/bs")
{
requestType = TRequestType.RequestBootstrap;
}
}
if (requestType == TRequestType.NotSet)
{
exchange.SendReject();
}
else
{
AddRequest(requestType, exchange);
}
}