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. Managed C++/CLI
  4. socket

socket

Scheduled Pinned Locked Moved Managed C++/CLI
tutorialquestion
4 Posts 4 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.
  • N Offline
    N Offline
    Ni m
    wrote on last edited by
    #1

    how to set send & recv timeout for TCP?

    T K 2 Replies Last reply
    0
    • N Ni m

      how to set send & recv timeout for TCP?

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      repost[^]


      TOXCCT >>> GEII power

      1 Reply Last reply
      0
      • N Ni m

        how to set send & recv timeout for TCP?

        K Offline
        K Offline
        kmcguire
        wrote on last edited by
        #3

        Try changing the Socket.Blocking Property to false. That way when you call the connect method you can go into you're own loop counting the amount of time you want to wait, but, make sure the socket is on a seperate thread if it has to be or something to keep it working while you loop is working. You could also try putting you're loop to sleep a number of milli-seconds or seconds to allow the socket to make its connection or not. while( [it hasnt been 10 seconds] ) { /* time code */ Threading::Thread::CurrentThread->Sleep( 1000 ); }

        N 1 Reply Last reply
        0
        • K kmcguire

          Try changing the Socket.Blocking Property to false. That way when you call the connect method you can go into you're own loop counting the amount of time you want to wait, but, make sure the socket is on a seperate thread if it has to be or something to keep it working while you loop is working. You could also try putting you're loop to sleep a number of milli-seconds or seconds to allow the socket to make its connection or not. while( [it hasnt been 10 seconds] ) { /* time code */ Threading::Thread::CurrentThread->Sleep( 1000 ); }

          N Offline
          N Offline
          neurorebel
          wrote on last edited by
          #4

          Use the appropriate WSAxxxxxx functions... FD_SETs and so on. Using threads and while loops is non-efficient in my opinion. And what do you exactly want to do ?? Is it a serving socket or a client one ? Why 10 seconds ? I can help more if you clarify your question.

          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