Option Explicit
Private Sub Form_Load ()
'initialize the Socket
With Winsock1
'use the UDP protocol
The Protocol=sckUDPProtocol
'the local port
. LocalPort=22
'open the Socket
The Bind
End With
Text1. Text=""
Me. The Caption="UDP receiver program"
End Sub
Private Sub Form_Unload (Cancel As Integer)
'close the window when close the socket first
Winsock1. Close
End Sub
Private Sub Winsock1_DataArrival (ByVal bytesTotal As Long)
'receiving data
Dim strData As String
Winsock1. GetData strData, vbString
'will receive displayed in the textBox1
Text1. Text=Text1. Text + + vbCrLf strData
End Sub
CodePudding user response:
In the management console to open the udp port, before I was the most,CodePudding user response:
The admin console where the UDP port Settings?