Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ASP.NET -> Ajax And Comet - Braindump

ASP.NET -> Ajax And Comet - Braindump

Scheduled Pinned Locked Moved ASP.NET
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    James Simpson
    wrote on last edited by
    #1

    Hey, Im trying to implement long-lived ajax connections (aka the comet pattern) in a WCF service I have written. The issue is the obvious gobbling up of ASP.NET threads - which would literally limit 1 per connection. So, ideas started flying around - and the idea of an Async HTTP handler came to light, with the ability to send the processing of the wait loop in the connection to a different thread thus returning the ASP.NET thread back to the pool to process other page requests. THe bottle neck now still lives on whatever I employ to handle the waitloop (probably a custom TCP service, keeping a socket open) So, I thought some more and wondered if it would be possible to have a Async Handler, that handed off execution to a service say 100 threads in which are typically looping around and these can be used to handle the wait loop for the long lived connection. Now if more than 100 connections exist, I thought about putting more than 1 connection on the same thread, which I think would require a custom TCP server. e.g Client -> ASP.NET ASync Handler -> Open Connection To Server Async -> Send Request -> Async Wait For Response -> Async On the service I would use a non blocking socket calls (e.g the IO Completion ports, beginreceive etc..) to accept the connections and send and receive data, and it would put the connection handling the request in some sort of queue that can be handled by one of the 100 threads in the service. If more than 100 connections come in, it would start to reuse the while loops (e.g iterate, test messages for connection 1, iterate, test messages for connection 2... iterate, test messages for connection 3... ) Obviously those 100 threads would be configurable, and I may only need 10, or twenty ... I am assuming that using sockets I am not consuming a thread until a Begin operation, e.g inbetween they waiting to be resused, which would essentially make the system scalable? And because Im not handling the wait loop in the End operation of the socket call, im not keeping the socket thread open, im handing it of to one of the 100 (or 10, 20) threads in the service which can queue automatically... Any thoughts? I hope i Have explained myself correctly... THanks, James

    James Simpson Web Developer imebgo@hotmail.com P S - This is what part of the alphabet would look like if Q and R were eliminated
    Mitch Hedberg

    C 1 Reply Last reply
    0
    • J James Simpson

      Hey, Im trying to implement long-lived ajax connections (aka the comet pattern) in a WCF service I have written. The issue is the obvious gobbling up of ASP.NET threads - which would literally limit 1 per connection. So, ideas started flying around - and the idea of an Async HTTP handler came to light, with the ability to send the processing of the wait loop in the connection to a different thread thus returning the ASP.NET thread back to the pool to process other page requests. THe bottle neck now still lives on whatever I employ to handle the waitloop (probably a custom TCP service, keeping a socket open) So, I thought some more and wondered if it would be possible to have a Async Handler, that handed off execution to a service say 100 threads in which are typically looping around and these can be used to handle the wait loop for the long lived connection. Now if more than 100 connections exist, I thought about putting more than 1 connection on the same thread, which I think would require a custom TCP server. e.g Client -> ASP.NET ASync Handler -> Open Connection To Server Async -> Send Request -> Async Wait For Response -> Async On the service I would use a non blocking socket calls (e.g the IO Completion ports, beginreceive etc..) to accept the connections and send and receive data, and it would put the connection handling the request in some sort of queue that can be handled by one of the 100 threads in the service. If more than 100 connections come in, it would start to reuse the while loops (e.g iterate, test messages for connection 1, iterate, test messages for connection 2... iterate, test messages for connection 3... ) Obviously those 100 threads would be configurable, and I may only need 10, or twenty ... I am assuming that using sockets I am not consuming a thread until a Begin operation, e.g inbetween they waiting to be resused, which would essentially make the system scalable? And because Im not handling the wait loop in the End operation of the socket call, im not keeping the socket thread open, im handing it of to one of the 100 (or 10, 20) threads in the service which can queue automatically... Any thoughts? I hope i Have explained myself correctly... THanks, James

      James Simpson Web Developer imebgo@hotmail.com P S - This is what part of the alphabet would look like if Q and R were eliminated
      Mitch Hedberg

      C Offline
      C Offline
      ChrisKo 0
      wrote on last edited by
      #2

      Why not just us MSM[^]

      J 1 Reply Last reply
      0
      • C ChrisKo 0

        Why not just us MSM[^]

        J Offline
        J Offline
        James Simpson
        wrote on last edited by
        #3

        I read that article, and the comments indicate its using Flash Component for data transfer, which would explain how we can have a socken in the browser. Im looking for a method that does not use anything on the client, apart from the usual Javascript available.. Its a different approach - so Im going to download the article code tonight and see how helpful it is. Thanks, James

        James Simpson Web Developer imebgo@hotmail.com P S - This is what part of the alphabet would look like if Q and R were eliminated
        Mitch Hedberg

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups