Home > Software engineering >  VB use ali cloud server implementation UDP penetrate
VB use ali cloud server implementation UDP penetrate

Time:09-19

I bought a fixed on ali cloud public IP, think as UDP server, single ali cloud server, after go in ipconfig shows the Intranet private IP, call ali cloud, customer service, said to my public IP network and I bundle mapping of IP is one by one, but I send this public IP UDP data on the client, can not accept to UDP data on the server, please god help me have a look at what causes, with the UDP server receives the code;

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?
  • Related