I am trying to write a simple Ping program with VB 6.0 Pro.
I have made an assumption that I should be using UDP rather
than TCP. Maybe I've already made a wrong turn...
I have a form with the Winsock control and a single button on it.
Here's the code I hoped would work. 204.71.177.35 is a valid
address that I can ping with the W95 Ping program. When I click
the Ping button on the form to execute this first section of code,
nothing comes back (the _DataArrival routine is never triggered).
This seems like a simple problem to me. Any help or ideas would
be greatly appreciated.
Dave
Private Sub cmdPing_Click()
With udpControl
.RemoteHost = "204.71.177.35"
.RemotePort = 80 ' Port to connect to. 1001?
.Bind 1001
.SendData "testing, 1, 2, 3..."
End With
End Sub
Private Sub udpControl_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
udpControl.GetData strData
MsgBox strData
End Sub
--
Dave Grimmer
Ohio Star Software