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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Sockets - Intensive I/O Issues

Sockets - Intensive I/O Issues

Scheduled Pinned Locked Moved C#
csharpdotnetdata-structuresdebugginghelp
3 Posts 2 Posters 1 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.
  • M Offline
    M Offline
    mcljava
    wrote on last edited by
    #1

    I have a Sockets based client using the Async model under C# .NET (i.e. BeginReceive, EndReceive, etc w/ non-blocking socket). I have noticed that under intensive I/O scenarios that the TCP logic (in CLR?) seems to overflowing my buffer. This happens only when I build for release, as you could image when building for debug the extra stack, heap, and instrutions executed tend to mask the problem. I was wondering if anyone has developed a I/O intensive packet handling hunk of code and what pitfalls, and/or recommendations do you have? Open to suggestions... Mike

    L 1 Reply Last reply
    0
    • M mcljava

      I have a Sockets based client using the Async model under C# .NET (i.e. BeginReceive, EndReceive, etc w/ non-blocking socket). I have noticed that under intensive I/O scenarios that the TCP logic (in CLR?) seems to overflowing my buffer. This happens only when I build for release, as you could image when building for debug the extra stack, heap, and instrutions executed tend to mask the problem. I was wondering if anyone has developed a I/O intensive packet handling hunk of code and what pitfalls, and/or recommendations do you have? Open to suggestions... Mike

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      I have seen TcpClient reorder packets under 'heavy' load. xacc.ide-0.1 released! Download and screenshots

      M 1 Reply Last reply
      0
      • L leppie

        I have seen TcpClient reorder packets under 'heavy' load. xacc.ide-0.1 released! Download and screenshots

        M Offline
        M Offline
        mcljava
        wrote on last edited by
        #3

        That does not surprise me, when I was using TcpClient I was not please with the level of control I wanted without restoring to lots of translation to the underlying Sockets interface. So... I switched to System.Net.Sockets interface and use the Berkely/Winsock approach. All goes well until heavy load when for some strange reason the BeginReceive() function chokes with a corrupted arg list. Note, my app uses a 2 stage read. Stage 1 is read the fixed length Message Header which contains the Type and Length of the payload. Stage 2 is read the variable length payload. I am wondering if I need to do any special initialization to accomodate a data stream that is flinging messages in size from (12 bytes to roughly 6K) at a real time rate proportional to the the number of calls handled per second across a call center with roughly 500 agents, i.e. the firehose I alluded to earlier. Typically we are talking 1.5 to 3 calls per second, plus all sorts of other events such as Agent State changes, Monitors, etc. Mike

        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