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. how to set the connection time out for a tcp client

how to set the connection time out for a tcp client

Scheduled Pinned Locked Moved C#
tutorialquestion
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.
  • P Offline
    P Offline
    prasadbuddhika
    wrote on last edited by
    #1

    i searched no this to set the time out , i found that there is no such method and by default it waits 15 seconds, and i saw a sample using a timer , but need to know a better solution for this , is any idea ?

    J 1 Reply Last reply
    0
    • P prasadbuddhika

      i searched no this to set the time out , i found that there is no such method and by default it waits 15 seconds, and i saw a sample using a timer , but need to know a better solution for this , is any idea ?

      J Offline
      J Offline
      Jimmanuel
      wrote on last edited by
      #2

      Using asynchronous methods and a timer is pretty much how you do it. If you aren't happy with that then you could create a wrapper class that hides all of the details and offers a Connect(address, port, timeout) method to make things easier for yourself.

      :badger:

      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