How to monitor connection lost to remote server using vb6?
I have an application that connects to a remote server. I wonder if there is a way to monitor the connection ip and port and if there is not connectivity i get prompted by massage box sayiing u lost connecton to remote server. I be happy if some one show me how this can be done.Thanks
Re: How to monitor connection lost to remote server using vb6?
Is this remote server a web server? Because if it is, it would be about 300 times easier than using winsock.
Re: How to monitor connection lost to remote server using vb6?
ok i got just the fix to your problem.
add a timer to the client project and add this code to the timer
Code:
VB Code:
Private Sub Timer1_Timer() 'example timer
if Winsock1.State <> SckConnected then
MsgBox "you got disconnected"
Timer1.Enabled = False
End If
End Sub
What you could do is activate timer when you press the connect button so like that you don't get the message before you connect. If the server get's errored then you could use a code like this.
Code:
VB Code:
Private Sub Winsock1_Error() 'i forget variables but just look through winsock 'subs
MsgBox "you got disconnected"
End Sub
i believe that that would also be good to add to your code. Hope i helped you.
If i did Please rate me for i never get rated for my help.
P.S thanks in advance. :afrog:
Re: How to monitor connection lost to remote server using vb6?
Thank u guys for u nice reply . The applicaton is an massanger program(external) and it is not http connection.
Re: How to monitor connection lost to remote server using vb6?
Thanks And if we've helped you please rate us accordingly. :p
Re: How to monitor connection lost to remote server using vb6?
If your making a chat program then i've got you a program i made that should help you on lots of thigs here you go and download zip at bottom of page.
http://vbforums.com/showthread.php?t=413306
Re: How to monitor connection lost to remote server using vb6?
well i still did not get help. i am not creating any chat system. I want monitor of this msn type of program that i did not made it . I want to get notified when it lost connection to msn server. How i do that ?
Re: How to monitor connection lost to remote server using vb6?
Post the code ill help you do it.