October 22, 2016
Hot Topics:

Communicating over a Network

  • November 19, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »

The last thing you will discover in this article are operation time outs. When using the Winsock control, or in fact any Internet comms control, you need to be able to detect a time out. This occurs, for instance, when an application you are talking to stops responding while you are communicating with it. If you didn't watch for a time out, then you program would just sit around waiting for the other program to respond. The easiest way to watch for these is by using a timer control.

By setting the Interval property to a reasonable length, for instance 30000, then you can detect time outs. Again, use events to tell the user what's going on. You need to do this in the timers Timer event:

Private Sub Timer1_Timer()

RaiseEvent TimeOut

End Sub

To finish, here are some quick guidelines for specifying addresses:

  1. Where possible use an IP address ( instead of computer names because the Winsock control has to resolve a host name to an IP address - this takes some time.
  2. If you connect to the net over a dial up connection, you can still get this to work. When you have logged on, use the Winsock's LocalIP method to return to current IP address. This way you can send it to your friend and he/she can connect to you.

  3. Page 7 of 7

    Comment and Contribute


    (Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date
Rocket Fuel