I do not want to ask if the comet is easier in ASPNET than in Jetty? I mean, is Comet simpler than ASPNET or Jetty compared to other alternatives? I think the asynchronous capabilities of ASP.NET and Jetty specifically make Comet more scalable when implemented on these platforms, and I would like to confirm this.
ASPNET introduced Asynchronous Pages back in 2005. The idea was to apply the familiar .NET asynchronous model to ASP.NET page processing ,
public partial class AsyncPage : System.Web.UI.Page
{
private WebRequest _request;
void Page_Load (object sender, EventArgs e)
{
AddOnPreRenderCompleteAsync (
new BeginEventHandler(BeginAsyncOperation),
new EndEventHandler (EndAsyncOperation)
);
}
IAsyncResult BeginAsyncOperation (object sender, EventArgs e,
AsyncCallback cb, object state)
{
_request = WebRequest.Create("http://msdn.microsoft.com");
return _request.BeginGetResponse (cb, state);
}
void EndAsyncOperation (IAsyncResult ar)
{
string text;
using (WebResponse response = _request.EndGetResponse(ar))
{
using (StreamReader reader =
new StreamReader(response.GetResponseStream()))
{
text = reader.ReadToEnd();
}
}
Regex regex = new Regex ("href\\s*=\\s*\"([^\"]*)\"",
RegexOptions.IgnoreCase);
MatchCollection matches = regex.Matches(text);
StringBuilder builder = new StringBuilder(1024);
foreach (Match match in matches)
{
builder.Append (match.Groups[1]);
builder.Append("<br/>");
}
Output.Text = builder.ToString ();
}
}
Q1: Does this not make ASP.NET scale much better for Comet style applications? Has anyone used this and tested it?
, . , Jetty - , Comet.
Q2: - ?