本文整理汇总了C#中IServerResponseChannelSinkStack类的典型用法代码示例。如果您正苦于以下问题:C# IServerResponseChannelSinkStack类的具体用法?C# IServerResponseChannelSinkStack怎么用?C# IServerResponseChannelSinkStack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IServerResponseChannelSinkStack类属于命名空间,在下文中一共展示了IServerResponseChannelSinkStack类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AsyncProcessResponse
public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state,
IMessage msg, ITransportHeaders headers, Stream responseStream)
{
ContextWithId ctx = (ContextWithId) state;
WriteOut (ctx.Context, headers, responseStream);
ctx.Context.Response.Close ();
}
示例2: GetResponseStream
public Stream GetResponseStream (IServerResponseChannelSinkStack sinkStack,
object state,
IMessage msg,
ITransportHeaders headers)
{
return null;
}
示例3: 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
);
}
示例4: GetResponseStream
public Stream GetResponseStream (IServerResponseChannelSinkStack sinkStack,
object state,
IMessage msg,
ITransportHeaders headers)
{
throw new NotImplementedException();
}
示例5: AsyncProcessResponse
public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack,
object state,
IMessage msg,
ITransportHeaders headers,
Stream stream)
{
throw new NotSupportedException (); // Never called
}
示例6: GetResponseStream
public Stream GetResponseStream(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers)
{
HttpServerSocketHandler handler = (HttpServerSocketHandler) state;
if (handler.AllowChunkedResponse)
{
return handler.GetResponseStream("200", "OK", headers);
}
return null;
}
示例7: AsyncProcessResponse
public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack
, object state
, IMessage msg
, ITransportHeaders headers
, Stream stream)
{
SerializeResponseMessage(sinkStack, msg, ref headers, ref stream);
sinkStack.AsyncProcessResponse(msg, headers, stream);
}
示例8: AsyncProcessResponse
public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state,
IMessage msg, ITransportHeaders headers, Stream responseStream)
{
ClientConnection connection = (ClientConnection)state;
NetworkStream stream = new NetworkStream (connection.Client);
UnixMessageIO.SendMessageStream (stream, responseStream, headers, connection.Buffer);
stream.Flush ();
stream.Close ();
}
示例9: 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);
}
示例10: AsyncProcessResponse
/// <summary></summary>
public void AsyncProcessResponse(
IServerResponseChannelSinkStack sinkStack,
Object state,
IMessage message,
ITransportHeaders headers,
Stream stream)
{
SetClientIpAddressDataHelper(headers);
sinkStack.AsyncProcessResponse(message, headers, stream);
}
示例11: 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);
}
示例12: 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);
}
示例13: 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);
}
示例14: AsyncProcessResponse
public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream)
{
HttpServerSocketHandler handler = null;
handler = (HttpServerSocketHandler) state;
handler.SendResponse(stream, "200", "OK", headers);
if (handler.CanServiceAnotherRequest())
{
handler.BeginReadMessage();
}
else
{
handler.Close();
}
}
示例15: GetResponseStream
public Stream GetResponseStream(IServerResponseChannelSinkStack sinkStack, object state, IMessage responseMsg, ITransportHeaders responseHeaders)
{
// parameters validation
if (responseHeaders == null)
throw new ArgumentNullException("responseHeaders");
IMethodReturnMessage methodReturn = responseMsg as IMethodReturnMessage;
if (methodReturn == null)
throw new NotSupportedException();
IConnection connection = state as IConnection;
if (connection == null)
throw new NotSupportedException();
// return stream for writing response
return connection.GetResponseStream(methodReturn, responseHeaders);
}