本文整理汇总了C#中Channel.setRequestHandler方法的典型用法代码示例。如果您正苦于以下问题:C# Channel.setRequestHandler方法的具体用法?C# Channel.setRequestHandler怎么用?C# Channel.setRequestHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel.setRequestHandler方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: startChannel
public virtual void startChannel(Channel channel, System.String encoding, System.String data)
{
log.debug("SASL-OTP Start Channel CCL");
clearCredential(channel.Session, this);
OTPAuthenticator temp = new OTPAuthenticator(this);
try
{
channel.setRequestHandler(temp);
temp.started(channel);
}
catch (SASLException x)
{
//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"'
throw new StartChannelException(BEEPError.CODE_REQUESTED_ACTION_NOT_TAKEN, x.Message);
}
log.debug("Started an SASL-OTP Channel");
}
示例2: started
/// <summary> API for both Listener and Initiator</summary>
internal virtual void started(Channel ch)
{
log.debug("Starting OTP Authenticator");
if (state != STATE_UNKNOWN)
{
throw new SASLException(ERR_OTP_STATE);
}
state = STATE_STARTED;
channel = ch;
channel.setRequestHandler(this);
}