UdpSocket. Protocol=sckUDPProtocol 'select UDP Protocol
UdpSocket. RemoteHost=IPAdr. Text 'choose the destination IP address
UdpSocket. RemotePort=2006 'choice destination port
UdpSocket. Bind 2006 'local port
End Sub
Private Sub Command2_Click ()
UdpSocket. SendData publishes the event TextSend. Send message Text '
TextSend. Text="" 'empty Text box
End Sub
Private Sub Label1_Click ()
End Sub
Private Sub UdpSocket_DataArrival (ByVal bytesTotal As Long)
Dim strData As String
UdpSocket. GetData strData 'receiving data
TextRecieve. Text=TextRecieve & amp; CRH (13) & amp; CRH (10) 'after the old data and carriage returns
TextRecieve. Text=TextRecieve & amp; StrData 'to add new data to the old data after
End Sub
Have good people to help me see what's the problem with this program, title is used: the UDP protocol design a chat program, experimental platform development platform can choose Visual Basic or Visual c + + development platform, etc., the program after the input to the computer to run the program, enter the IP address of the chat object, determined, began to chat, to change the IP address, chatting with another object,
Asked the man to help answer, thank you very much
CodePudding user response:
See the MSDN for an explanation of the winsock control,Or look at the following, basically is the piece of content that MSDN
https://www.cnblogs.com/hubery/archive/2013/08/07/3244048.html