|
-
Jul 1st, 2006, 07:20 AM
#1
Thread Starter
Frenzied Member
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
-
Jul 1st, 2006, 08:45 AM
#2
Hyperactive Member
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.
KAZAR
The Law Of Programming:
As the Number of Lines of code increases, the number of bugs generated by fixing a bug increases exponentially.
__________________________________
www.startingqbasic.co.uk
-
Jul 1st, 2006, 09:37 AM
#3
Hyperactive Member
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.
Coding's a Breeze if you'r at ease! GOD THATS CORNY!!
 - 
-
Jul 1st, 2006, 04:41 PM
#4
Thread Starter
Frenzied Member
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.
-
Jul 1st, 2006, 05:19 PM
#5
Hyperactive Member
Re: How to monitor connection lost to remote server using vb6?
Thanks And if we've helped you please rate us accordingly.
Coding's a Breeze if you'r at ease! GOD THATS CORNY!!
 - 
-
Jul 1st, 2006, 05:21 PM
#6
Hyperactive Member
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
Coding's a Breeze if you'r at ease! GOD THATS CORNY!!
 - 
-
Jul 1st, 2006, 08:35 PM
#7
Thread Starter
Frenzied Member
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 ?
-
Jul 2nd, 2006, 04:31 AM
#8
Hyperactive Member
Re: How to monitor connection lost to remote server using vb6?
Post the code ill help you do it.
Coding's a Breeze if you'r at ease! GOD THATS CORNY!!
 - 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|