[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

05/28/2007 at 03:18AM PDT, ID: 22597860
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

Pushlet like concept in ASP .Net

Asked by pamboo in Programming for ASP.NET, Dynamic HTML (DHTML), Miscellaneous Web Development

Tags: pushlet

I have a TCP server listening at say port 3005.Any TCP client can connect and recieve online transactions send by this server.My need is to recieve this data asyncronously in the web page and show the live transactions.

1.First method i tried was using User control(.Net Windows Control Library).
   I can able to run the user control without any problem on receiving the transactions asyncronously from the server using .Net raw sockets APIs.
   But when I run the same 'user control' in my web application , it throws socketpermission exception since .Net Code Access Security prevents connection to TCP ports which are not following HTTP protocols.The solution is to set the Machine Code security permissionset to "FullTrust" using caspol.exe utilty or framework console wizard.But the user at the client PC has to set this permission explicitly when he browse this control, which is not acceptable.

   I read atricles that one can set the socket permission unrestricted.To set the socket permission unrestricted , one need to set the securitypermission unrestricted first.I tried this and the same problem (Socket Permission Exception).No change in adding the following sets of code in my 'User control'

/*********************************************************************************************************/
  PermissionSet ps = new PermissionSet(PermissionState.None);
  ps.AddPermission(new SecurityPermission(PermissionState.Unrestricted));
  ps.AddPermission(new SocketPermission(PermissionState.Unrestricted));
  ps.Assert();
/*********************************************************************************************************/

2.Later after working 2 to 3 days , I thought of dropping this user control logic and went for AJAX related study work to achieve this.

As per my knowlegde , I see that the client has to poll anyway to the web server to recieve any updates using JS SetTimeout method and asyncronous callbacks to prevent full page refresh.This is something like client pull method.

I need to get asynchronous call back from the server to the client side by only one event request at the first and the web server has to subsequently send the updates whenever it recieve from the TCP server connected.

I just tried this small example on a simple ASP .NET web application button event,

/********************************************************************************************************/
      Try
            Dim i As Integer
            For i = 1 To 10
                Response.BufferOutput = False
                Response.Write("hello")
                Response.Flush()                
                Thread.Sleep(1000)
            Next
        Catch ex As Exception
        End Try
/********************************************************************************************************/

But the page is kept loading untill on the while llop ends and "Flush" method doesnt help as I thought.

So, the experts please give me a sloution in ASP .Net where I need to get the online transactions live on a web page without client refresh.

Is there anything like "Pushlets" of JAVA technology equivalent in .Net? i.e Instead of closing the HTTP connection after fetching an HTML page, the connection is kept open while fresh data is pushed to the client.

Experts ,  please help on this requirement. Experts can even please explain how to achieve the code security permission unrestricted inside the user control itself to connect to non HTTP TCP ports when called from web applicaiton.

P.S: I m not prefering for client pull method which i feel overloaded and unnecessary when the transactions occurance interval is unpredicatable.Only when the server receive the transaction , just push to the client is a best way, I feel.

Thanks and Regards,
Nagarajan S
 
Keywords: Pushlet like concept in ASP .Net
 
Loading Advertisement...
 
[+][-]05/29/07 03:59 AM, ID: 19171271

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, Dynamic HTML (DHTML), Miscellaneous Web Development
Tags: pushlet
Sign Up Now!
Solution Provided By: AGBrown
Participating Experts: 2
Solution Grade: A
 
 
[+][-]11/16/07 04:06 PM, ID: 20302523

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91