本文整理汇总了C#中IServerResponseChannelSinkStack.AsyncProcessResponse方法的典型用法代码示例。如果您正苦于以下问题:C# IServerResponseChannelSinkStack.AsyncProcessResponse方法的具体用法?C# IServerResponseChannelSinkStack.AsyncProcessResponse怎么用?C# IServerResponseChannelSinkStack.AsyncProcessResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServerResponseChannelSinkStack
的用法示例。
在下文中一共展示了IServerResponseChannelSinkStack.AsyncProcessResponse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AsyncProcessResponse
/// <summary></summary>
public void AsyncProcessResponse(
IServerResponseChannelSinkStack sinkStack,
Object state,
IMessage message,
ITransportHeaders headers,
Stream stream)
{
SetClientIpAddressDataHelper(headers);
sinkStack.AsyncProcessResponse(message, headers, stream);
}
示例2: AsyncProcessResponse
public void AsyncProcessResponse(
IServerResponseChannelSinkStack sinkStack,
object state,
IMessage msg,
ITransportHeaders headers,
Stream stream)
{
// Send the response to the client.
sinkStack.AsyncProcessResponse(msg, headers, stream);
}
示例3: AsyncProcessResponse
public void AsyncProcessResponse(
IServerResponseChannelSinkStack sinkStack,
Object state,
IMessage message,
ITransportHeaders headers,
Stream stream)
{
IPAddress ip = headers[CommonTransportKeys.IPAddress] as IPAddress;
CallContext.SetData("ClientIPAddress", ip);
sinkStack.AsyncProcessResponse(message, headers, stream);
}
示例4: AsyncProcessResponse
public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream)
{
ClientState cs = state as ClientState;
if (cs != null && cs.clientCompressed) {
// compress the shits
stream = CompressionHelper.CompressStream(stream);
headers[CompressionHelper.CompressKey] = CompressionHelper.CompressedFlag;
}
sinkStack.AsyncProcessResponse(msg, headers, stream);
}
示例5: AsyncProcessResponse
public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state,
IMessage message, ITransportHeaders headers, Stream stream)
{
ITransportHeaders responseHeaders = new TransportHeaders();
if (sinkStack != null) stream = sinkStack.GetResponseStream (message, responseHeaders);
if (stream == null) stream = new MemoryStream();
_binaryCore.Serializer.Serialize (stream, message, null);
if (stream is MemoryStream) stream.Position = 0;
sinkStack.AsyncProcessResponse (message, responseHeaders, stream);
}
示例6: AsyncProcessResponse
public void AsyncProcessResponse(
IServerResponseChannelSinkStack sinkStack_in,
object state_in,
IMessage message_in,
ITransportHeaders headers_in,
Stream stream_in
) {
CallContext.SetData(
"ClientIPAddress",
((IPAddress)headers_in[CommonTransportKeys.IPAddress]).ToString()
);
sinkStack_in.AsyncProcessResponse(
message_in,
headers_in,
stream_in
);
}
示例7: AsyncProcessResponse
public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage responseMsg, ITransportHeaders responseHeaders, Stream responseStream)
{
// parameters validation
if (sinkStack == null)
throw new ArgumentNullException("sinkStack");
if (responseHeaders == null)
throw new ArgumentNullException("responseHeaders");
if (responseStream == null)
throw new ArgumentNullException("responseStream");
var methodReturn = responseMsg as IMethodReturnMessage;
if (methodReturn == null)
throw new NotSupportedException();
// serialize response
_formatter.SerializeResponse(methodReturn, responseHeaders, responseStream);
// process response asynchronously
sinkStack.AsyncProcessResponse(responseMsg, responseHeaders, responseStream);
}
示例8: AsyncProcessResponse
public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage message, ITransportHeaders headers, Stream stream)
{
object obj1 = headers["__IPAddress"];
sinkStack.AsyncProcessResponse(message, headers, stream);
}
示例9: AsyncProcessResponse
public void AsyncProcessResponse(
IServerResponseChannelSinkStack sinkStack_in,
object state_in,
IMessage message_in,
ITransportHeaders headers_in,
Stream stream_in
) {
#if DEBUG
Console.WriteLine("compression sink: AsyncProcessResponse...");
#endif
bool _hasBeenCompressed = (bool)state_in;
if (_hasBeenCompressed) {
#region compress...
headers_in[CompressionHelper.X_COMPRESS] = "1";
stream_in = CompressionHelper.GetCompressedStreamCopy(
stream_in
);
#endregion
} else {
if (this.mustdo_) {
throw new Exception("\n\n\t\tyour activity is being logged!\n\n\t\tun-compressed communications not allowed!\n\n");
}
}
sinkStack_in.AsyncProcessResponse(
message_in,
headers_in,
stream_in
);
}
示例10: AsyncProcessResponse
//---------------------- Implement IServerChannelSink -------------------//
public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, System.Runtime.Remoting.Messaging.IMessage msg, ITransportHeaders headers, System.IO.Stream stream)
{
IPAddress ip = headers[CommonTransportKeys.IPAddress] as IPAddress;
CallContext.SetData("ClientIpAddress", ip);
sinkStack.AsyncProcessResponse(msg, headers, stream);
}
示例11: AsyncProcessResponse
public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state,
IMessage msg, ITransportHeaders headers, Stream stream)
{
ITransportHeaders responseHeaders = new TransportHeaders();
if(sinkStack != null) stream = sinkStack.GetResponseStream(msg, responseHeaders);
if(stream == null) stream = new MemoryStream();
SoapMessageFormatter soapMsgFormatter = (SoapMessageFormatter)state;
SoapMessage soapMessage = (SoapMessage) soapMsgFormatter.BuildSoapMessageFromMethodResponse((IMethodReturnMessage)msg, out responseHeaders);
_soapCore.Serializer.Serialize(stream, soapMessage, null);
if(stream is MemoryStream) stream.Position = 0;
sinkStack.AsyncProcessResponse (msg, responseHeaders, stream);
}
示例12: AsyncProcessResponse
public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state,
IMessage msg, ITransportHeaders headers, Stream stream)
{
// перенаправляем вызов следующему приемнику в цепи
sinkStack.AsyncProcessResponse(msg, headers, stream);
}
示例13: AsyncProcessResponse
public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state,
IMessage msg, ITransportHeaders headers, Stream stream) {
// headers, stream are null, because formatting is first sink to create these two
AsyncServerProcessingData asyncData = (AsyncServerProcessingData) state;
try {
IMessage requestMsg = asyncData.RequestMsg;
SerialiseResponse(sinkStack, requestMsg, asyncData.ServerCon, msg,
ref headers, out stream);
}
catch (Exception e) {
if (asyncData.RequestMsg is IMethodCallMessage) {
msg = new ReturnMessage(e, (IMethodCallMessage) asyncData.RequestMsg);
} else {
msg = new ReturnMessage(e, null); // no useful information present for requestMsg
}
// serialise the exception
SerialiseExceptionResponse(sinkStack, (IMessage)state, asyncData.ServerCon, msg,
ref headers, out stream);
}
sinkStack.AsyncProcessResponse(msg, headers, stream); // pass further on to the stream handling sinks
}
示例14: AsyncProcessResponse
public void AsyncProcessResponse(
IServerResponseChannelSinkStack sinkStack_in,
object state_in,
IMessage message_in,
ITransportHeaders headers_in,
Stream stream_in
) {
#if DEBUG
Console.WriteLine("encryption sink: AsyncProcessResponse");
#endif
bool _hasBeenEncrypted
= (state_in != null)
? ((StateStruct)state_in).isEncripted
: false
;
if (_hasBeenEncrypted) {
#region encrypt...
headers_in[EncryptionHelper.X_ENCRYPT] = "1";
stream_in
= EncryptionHelper.Encrypt(
stream_in,
true,
keyspath_,
((StateStruct)state_in).ClientID
);
#endregion
} else {
if (mustdo_) {
throw new Exception("\n\n\t\tyour activity is being logged!\n\n\t\tun-encrypted communications not allowed!\n\n");
}
}
sinkStack_in.AsyncProcessResponse(
message_in,
headers_in,
stream_in
);
}
示例15: AsyncProcessResponse
public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage message, ITransportHeaders headers, Stream stream)
{
stream = Zip.Compress(stream);
sinkStack.AsyncProcessResponse(message, headers, stream);
}