public ChannelUpstreamRequest(HttpContext context, AsyncCallback asyncCallback, object extraData, ProtoProxyClient client) : base(context, asyncCallback, extraData) { _client = client; _client.Touch(); HandleRequest(); SetAsCompleted(null, true); }
public StreamDownloadRequest(HttpContext context, AsyncCallback asyncCallback, object extraData, ProtoProxyClient client, int associationId) : base(context, asyncCallback, extraData) { Require.NotNull(client, "client"); _client = client; _associationId = associationId; _client.Touch(); HandleRequest(); }
public StreamUploadRequest(HttpContext context, AsyncCallback asyncCallback, object extraData, ProtoProxyClient client, int? associationId) : base(context, asyncCallback, extraData) { Require.NotNull(client, "client"); _client = client; _associationId = associationId; _client.Touch(); if (context.Request.Files.Count == 0) SetAsCompleted(null, true); else HandleRequest(); _inConstructor = false; }
public ChannelDownstreamRequest(HttpContext context, AsyncCallback asyncCallback, object extraData, ProtoProxyClient client) : base(context, asyncCallback, extraData) { Created = DateTime.Now; _client = client; _client.Touch(); string downstreamIdString = Context.Request.QueryString["DID"]; if (downstreamIdString != null) { int downstreamId; if (!int.TryParse(downstreamIdString, NumberStyles.None, CultureInfo.InvariantCulture, out downstreamId)) throw new ProtoChannelException("Invalid DID query string parameter"); _downstreamId = downstreamId; } if (_downstreamId.HasValue) { // For IE, we communicate through framed JSON. This requires // us to set the content type to text/html. Ensure that dynamic // compression is disabled in web.config. Context.Response.ContentType = "text/html"; // Send 1K in padding. Context.Response.Write(IframePadding); Context.Response.Flush(); } else { // Below content type is not gzipped by default. Gzipping the response // has the effect that chunked transport encoding doesn't work anymore. Context.Response.ContentType = "application/octet-stream"; } _client.AssignDownstream(this); }
public static void PostMessage(ProtoProxyClient client, object message) { client.Client.PostMessage(message); }
public static void BeginSendMessage(ProtoProxyClient client, object message, uint associationId) { var pendingMessage = new PendingMessage(client, associationId); client.Client.BeginSendMessage(message, null, pendingMessage.EndSendMessage, null); }
public PendingMessage(ProtoProxyClient client, uint associationId) { Require.NotNull(client, "client"); _client = client; _associationId = associationId; }
public void RemoveClient(ProtoProxyClient client) { Require.NotNull(client, "client"); lock(_syncRoot) { _clients.Remove(client.Key); } }