471,605 Members | 1,354 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

timed actions

Hi

How do i set a socket to wait for a reply after a set time frame? For
example the following scenarios:

1) Give a user 10 seconds to respond after which time send an automatic
message to the server from the client to do a default action
2) set a time limit to give the server time to respond before continuing

I have a lobby as part of my project and i need the lobby data to be
retrieved from the server. I do this by initialising a lobby object on the
server when it starts. All clients who connect send a request for the lobby
and i then serialise this object and send it to the client who deserialises
it initialising their local object to an exact copy of the server lobby
object at that point.

So i would like to set some form of time frame not only for general timeouts
but for making sure my client has the lobby data before continuning. Whats
the best way?

Feb 20 '06 #1
2 2039
Hello, Daniel!

D> How do i set a socket to wait for a reply after a set time frame? For
D> example the following scenarios:

D> 1) Give a user 10 seconds to respond after which time send an automatic
D> message to the server from the client to do a default action
D> 2) set a time limit to give the server time to respond before continuing

Does user interact via graphical user interface (GUI)? If so you can consider timed actions on the GUI level.
You can use System.Windows.Forms.Timer for the purpose of timed events...

OTOH you can use System.Threading.Timer if you want the timed event to be executed on the level of network I/O
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 20 '06 #2
Did you find an answer to this?

I’m looking for some vb.net syntax for binding an event to a thread that I
can abort after a few seconds when the udpclient connection fails to get a
response. This is part of a forms based application. I'm passing some values
in the processing.

segue

"Daniel" wrote:
Hi

How do i set a socket to wait for a reply after a set time frame? For
example the following scenarios:

1) Give a user 10 seconds to respond after which time send an automatic
message to the server from the client to do a default action
2) set a time limit to give the server time to respond before continuing

I have a lobby as part of my project and i need the lobby data to be
retrieved from the server. I do this by initialising a lobby object on the
server when it starts. All clients who connect send a request for the lobby
and i then serialise this object and send it to the client who deserialises
it initialising their local object to an exact copy of the server lobby
object at that point.

So i would like to set some form of time frame not only for general timeouts
but for making sure my client has the lobby data before continuning. Whats
the best way?

Apr 7 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by William F. Robertson, Jr. | last post: by
5 posts views Thread by Sachin Surana | last post: by
6 posts views Thread by Daniel Walzenbach | last post: by
10 posts views Thread by Jim Underwood | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.