socket
-
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 ); }
-
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 ); }
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.