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. Async sockets

Async sockets

Scheduled Pinned Locked Moved C#
questionadobesysadminlounge
5 Posts 3 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.
  • H Offline
    H Offline
    Haim Nachum
    wrote on last edited by
    #1

    Hi. Im building a web chat application and im using async sockets in the server-side. The client connects to the server socket via flash component. My question is , when does the connection dies? if i close my browser i see that the server is closing the connection. is that because TCP socket sends data every x seconds to check the connection? and if it does , can i rely on it? or should i use UDP socket and try to handle the connection state myself. Thank you.

    D R 2 Replies Last reply
    0
    • H Haim Nachum

      Hi. Im building a web chat application and im using async sockets in the server-side. The client connects to the server socket via flash component. My question is , when does the connection dies? if i close my browser i see that the server is closing the connection. is that because TCP socket sends data every x seconds to check the connection? and if it does , can i rely on it? or should i use UDP socket and try to handle the connection state myself. Thank you.

      D Offline
      D Offline
      David1987
      wrote on last edited by
      #2

      TCP uses an explicit RST (reset) message to close a connection. The connection can also die due to a timeout.

      H 1 Reply Last reply
      0
      • H Haim Nachum

        Hi. Im building a web chat application and im using async sockets in the server-side. The client connects to the server socket via flash component. My question is , when does the connection dies? if i close my browser i see that the server is closing the connection. is that because TCP socket sends data every x seconds to check the connection? and if it does , can i rely on it? or should i use UDP socket and try to handle the connection state myself. Thank you.

        R Offline
        R Offline
        Rick Shaub
        wrote on last edited by
        #3

        TCP sockets are by definition reliable. UDP sockets on the other hand are not. As stated above, the browser is closing the connection explicitly.

        1 Reply Last reply
        0
        • D David1987

          TCP uses an explicit RST (reset) message to close a connection. The connection can also die due to a timeout.

          H Offline
          H Offline
          Haim Nachum
          wrote on last edited by
          #4

          Where is the timeout for the connection set?

          D 1 Reply Last reply
          0
          • H Haim Nachum

            Where is the timeout for the connection set?

            D Offline
            D Offline
            David1987
            wrote on last edited by
            #5

            socket.ReceiveTimeout and SendTimeout

            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