本文整理汇总了C#中Response.SetTransactionID方法的典型用法代码示例。如果您正苦于以下问题:C# Response.SetTransactionID方法的具体用法?C# Response.SetTransactionID怎么用?C# Response.SetTransactionID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Response
的用法示例。
在下文中一共展示了Response.SetTransactionID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendResponse
/**
* Sends the specified response message through the specified access point.
*
* @param transactionID the id of the transaction to use when sending the
* response. Actually we are getting kind of redundant here as we already
* have the id in the response object, but I am bringing out as an extra
* parameter as the user might otherwise forget to explicitly set it.
* @param response the message to send.
* @param sendThrough the access point to use when sending the message.
* @param sendTo the destination of the message.
* @throws StunException TRANSACTION_DOES_NOT_EXIST if the response message
* has an invalid transaction id. <br/>
* ILLEGAL_STATE if the stun stack is not started. <br/>
* ILLEGAL_ARGUMENT if the apDescriptor references an access point that had
* not been installed <br/>
* NETWORK_ERROR if an error occurs while sending message bytes through the
* network socket. <br/>
*/
public virtual void SendResponse(byte[] transactionID,
Response response,
NetAccessPointDescriptor sendThrough,
StunAddress sendTo)
{
stunStack.CheckStarted();
TransactionID tid = TransactionID.CreateTransactionID(transactionID);
serverTransactions.Remove(tid);
#if false
throw new StunException(StunException.TRANSACTION_DOES_NOT_EXIST,
"The trensaction specified in the response "
+"object does not exist.");
#endif
response.SetTransactionID(transactionID);
GetNetAccessManager().SendMessage(response, sendThrough, sendTo);
}