I found a thread about "VB6 - Winsock, Auto find server using UDP Broadcast (LAN ONLY)" post by CVMichael and reply of Aan2702 his post and code and sample attached file i test it and that's what i want when any another 2 PC running U'r winsock sever application. All winsock server
send(Broadcast) their IP addres to PC whose Running Winsock Client(Bind).
what if all running winsock server and their multiple winsock client will send(broadcast) their ip address to PC whose running as server and putting it into all listbox...can you help with that, that's what i want in your code in CVmichael thread is server send(broadcast)their ip address whos running as a client...
And me as a server....
Thanks.....
Here's the file of they use
From Server:
From Client:Code:Private Sub Command1_Click() On Error Resume Next For x = 420 To 440 Winsock1.Close Winsock1.RemoteHost = "255.255.255.255" Winsock1.RemotePort = x Winsock1.SendData Winsock1.LocalIP Next Timer1.Enabled = True End Sub Private Sub Form_Load() Winsock1.Close Me.Caption = "BoardCast Server" End Sub Private Sub Timer1_Timer() Command1_Click End Sub
Code:Dim IP As Integer Private Sub Form_Load() Me.Caption = "BoardCast Client" IP = 420 On Error GoTo errIP Winsock1.Bind IP Exit Sub errIP: IPIncrease Exit Sub End Sub Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) On Error GoTo errIP Dim strData As String Winsock1.GetData strData Text1.Text = strData Exit Sub errIP: IPIncrease End Sub Sub IPIncrease() On Error GoTo errIP IP = IP + 1 Winsock1.Close Winsock1.Bind IP Exit Sub errIP: IPIncrease End Sub




Reply With Quote