Results 1 to 8 of 8

Thread: How to monitor connection lost to remote server using vb6?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    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

  2. #2
    Hyperactive Member kazar's Avatar
    Join Date
    Apr 2006
    Location
    UK
    Posts
    323

    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

  3. #3
    Hyperactive Member g4hsean's Avatar
    Join Date
    May 2006
    Posts
    267

    Talking 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:
    1. Private Sub Timer1_Timer() 'example timer
    2. if Winsock1.State <> SckConnected then
    3. MsgBox "you got disconnected"
    4. Timer1.Enabled = False
    5. End If
    6. 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:
    1. Private Sub Winsock1_Error() 'i forget variables but just look through winsock 'subs
    2. MsgBox "you got disconnected"
    3. 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!!
    -

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    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.

  5. #5
    Hyperactive Member g4hsean's Avatar
    Join Date
    May 2006
    Posts
    267

    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!!
    -

  6. #6
    Hyperactive Member g4hsean's Avatar
    Join Date
    May 2006
    Posts
    267

    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!!
    -

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    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 ?

  8. #8
    Hyperactive Member g4hsean's Avatar
    Join Date
    May 2006
    Posts
    267

    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
  •  



Click Here to Expand Forum to Full Width