PDA

Click to See Complete Forum and Search --> : Winsock Question


Falcondl
Jan 4th, 2000, 09:50 AM
ok, umm, i have a control array. the first index of the control (0) is set to listen.

I wanted to know, is there any way i can find out the IP of the computer that triggers the ConnectionRequest event?

i dont think that the remotehostip property will return the IP, because it's not actually set to anything.

Could really use some help here. Thanks guys. :)

Clunietp
Jan 4th, 2000, 01:29 PM
The remotehostIP is populated automatically after a connection

This might help, sorry, I didn't test it...:

Private Sub Winsock1_ConnectionRequest(Index As Integer, _
ByVal requestID As Long)
Load Winsock1(Winsock1.Count + 1)
Winsock1(UBound(Winsock1)).Accept requestID
MsgBox Winsock1(UBound(Winsock1)).RemoteHostIP

End Sub

TKC
Jan 10th, 2000, 06:07 AM
Dim I as long
Private Sub Winsock1_ConnectionRequest(Index As Integer, _ ByVal requestID As Long)
If Index = 0 Then
I = I + 1
Load Winsock1(i)
Winsock1(I).Accept requestID
MsgBox Winsock1(I).RemoteHostIP
End If
End Sub

Peace out.. from a 14 year old

------------------
-(A)-
Later

Jan 10th, 2000, 05:37 PM
Private Sub Winsock1_ConnectionRequest(Index As Integer,ByVal requestID As Long
msgbox Winsock1(0).RemoteHostIP
.....................................
End Sub
GL

[This message has been edited by Babuger (edited 01-11-2000).]