Click here to Skip to main content
15,901,426 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Combine Printjobs Pin
tolarion24-Jun-13 12:24
tolarion24-Jun-13 12:24 
GeneralRe: Combine Printjobs Pin
Dave Kreskowiak24-Jun-13 15:39
mveDave Kreskowiak24-Jun-13 15:39 
GeneralRe: Combine Printjobs Pin
tolarion24-Jun-13 22:50
tolarion24-Jun-13 22:50 
AnswerRe: Combine Printjobs Pin
tolarion25-Jun-13 0:59
tolarion25-Jun-13 0:59 
AnswerRe: Combine Printjobs Pin
Eddy Vluggen25-Jun-13 10:02
professionalEddy Vluggen25-Jun-13 10:02 
GeneralRe: Combine Printjobs Pin
tolarion25-Jun-13 10:20
tolarion25-Jun-13 10:20 
GeneralRe: Combine Printjobs Pin
Eddy Vluggen26-Jun-13 6:42
professionalEddy Vluggen26-Jun-13 6:42 
QuestionMonitoring Socket with AutoResetEvent Pin
Dominick Marciano23-Jun-13 16:17
professionalDominick Marciano23-Jun-13 16:17 
I'm designing an application which consist of multiple clients that connect to a server using sockets. I'm trying to figure out a way to monitor the connection and if no data is transferred within a certain time from (say 1 minute) then the connection is closed (basically I'm trying to create a watchdog timer).

From what I've been reading it seems that I would need to use the AutoResetEvent class. The way I envisioned it working is that every time the server receives data from a client it resets the timer of the AutoResetEvent.WaitOne. What I've come up with so far is something like this in the server application:
VB
Dim autoEvent as New AutoResetEvent(False)
If autoEvent.WaitOne(1000) Then
   autoEvent.Reset
Else
   Close connection and inform user
End If

When the socket receives data it will call autoEvent.Set which will cause the autoEvent.Reset method to be called. This would obviously be started on a new thread so it wouldn't block the main thread handling the data.

Is this correct or is there a better way to do this? Any links to creating a watchdog timer would be appreciated also. Thanks in advance for any help with this.
AnswerRe: Monitoring Socket with AutoResetEvent Pin
Dave Kreskowiak24-Jun-13 2:19
mveDave Kreskowiak24-Jun-13 2:19 
GeneralRe: Monitoring Socket with AutoResetEvent Pin
Dominick Marciano25-Jun-13 20:10
professionalDominick Marciano25-Jun-13 20:10 
GeneralRe: Monitoring Socket with AutoResetEvent Pin
Dave Kreskowiak26-Jun-13 2:18
mveDave Kreskowiak26-Jun-13 2:18 
QuestionI am a Beginner, could you help please?. Pin
Member 1011870620-Jun-13 7:10
Member 1011870620-Jun-13 7:10 
AnswerRe: I am a Beginner, could you help please?. Pin
Dave Kreskowiak20-Jun-13 9:15
mveDave Kreskowiak20-Jun-13 9:15 
GeneralRe: I am a Beginner, could you help please?. Pin
PrissySC24-Jun-13 6:39
PrissySC24-Jun-13 6:39 
GeneralRe: I am a Beginner, could you help please?. Pin
Dave Kreskowiak24-Jun-13 7:18
mveDave Kreskowiak24-Jun-13 7:18 
GeneralRe: I am a Beginner, could you help please?. Pin
PrissySC25-Jun-13 4:30
PrissySC25-Jun-13 4:30 
GeneralRe: I am a Beginner, could you help please?. Pin
Dave Kreskowiak25-Jun-13 5:33
mveDave Kreskowiak25-Jun-13 5:33 
AnswerRe: I am a Beginner, could you help please?. Pin
PrissySC24-Jun-13 6:37
PrissySC24-Jun-13 6:37 
GeneralRe: I am a Beginner, could you help please?. Pin
Dave Kreskowiak24-Jun-13 7:17
mveDave Kreskowiak24-Jun-13 7:17 
GeneralRe: I am a Beginner, could you help please?. Pin
Member 1011870625-Jun-13 5:16
Member 1011870625-Jun-13 5:16 
GeneralRe: I am a Beginner, could you help please?. Pin
Member 1011870625-Jun-13 5:18
Member 1011870625-Jun-13 5:18 
GeneralRe: I am a Beginner, could you help please?. Pin
Dave Kreskowiak25-Jun-13 5:32
mveDave Kreskowiak25-Jun-13 5:32 
GeneralRe: I am a Beginner, could you help please?. Pin
Christianirwan26-Jun-13 0:25
Christianirwan26-Jun-13 0:25 
GeneralRe: I am a Beginner, could you help please?. Pin
Member 1011870626-Jun-13 2:08
Member 1011870626-Jun-13 2:08 
QuestionSystem.threading.timer() question Pin
econy19-Jun-13 14:50
econy19-Jun-13 14:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.