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. General Programming
  3. C#
  4. A TCPListner problem that i am not sure about

A TCPListner problem that i am not sure about

Scheduled Pinned Locked Moved C#
csharpasp-netsysadminhelp
2 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.
  • S Offline
    S Offline
    sameerhanda
    wrote on last edited by
    #1

    :confused::confused:Ok, I have a server app that various ASP.NET web pages call upon. This server APP does stuff based on the request string being sent in from the ASP.NET web pages. Well here's the problem. If 4 clients connect at the same time on 4 different threads thread all the requests finish ok; cause i can see them finish. However, when it comes time to sned the client a completed request back only thread 1 gets a completed string back indicating that the request was comnpleted successfully and I am ready for the next; but threads 2, 3, 4 seem to just hang. The moment I shut the server off i.e stop listening threads 2 ,3 ,4 seem to finish and they get a completed message back. Any ideas on why this maybe happening or advice.

    M 1 Reply Last reply
    0
    • S sameerhanda

      :confused::confused:Ok, I have a server app that various ASP.NET web pages call upon. This server APP does stuff based on the request string being sent in from the ASP.NET web pages. Well here's the problem. If 4 clients connect at the same time on 4 different threads thread all the requests finish ok; cause i can see them finish. However, when it comes time to sned the client a completed request back only thread 1 gets a completed string back indicating that the request was comnpleted successfully and I am ready for the next; but threads 2, 3, 4 seem to just hang. The moment I shut the server off i.e stop listening threads 2 ,3 ,4 seem to finish and they get a completed message back. Any ideas on why this maybe happening or advice.

      M Offline
      M Offline
      Marc Clifton
      wrote on last edited by
      #2

      Besides the obvious, that there is a bug in your code, I have experienced problems with the TcpClient class--losing data, basically. I've replaced the client-side with Indy Sockets[^] and my problem went away! BTW, the reason 2-4 are getting completed messages when you shut off the server is because the thread is actually exiting with a connection broken message. Off the cuff, I'd say you need to put in some more error checking to start with. Marc MyXaml Advanced Unit Testing YAPO

      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