Home > Software engineering >  Consult ace vb use the udp protocol error the run - time error '2'
Consult ace vb use the udp protocol error the run - time error '2'

Time:10-13


Downloaded from this BBS is a sample program

Private Sub CommandSendMsg_Click ()
Winsocksend. SendData publishes the event Text1. Text
End Sub



Private Sub Form_Load ()
With Winsocksend
The RemoteHost="192.168.1.255"
RemotePort=3001
LocalPort=4018
The Bind (4018)
End With
End Sub

Each run CommandSendMsg_Click time error prompts the run - time error '2', but in other people's computer operation no problem, no matter how to change the IP address of my computer will appear the error,

Please help to find out what is going on, thank you very much!

CodePudding user response:

Socket controls whether the selection is upd agreement

CodePudding user response:

Yes, has been selected the udp protocol, TCP protocol by default,

And search on the Internet about the run - time error '2' mistake that no; Nor does the debugging when the error of the help file

CodePudding user response:

The RemoteHost="192.168.1.255" should be the name of the computer not IP,

CodePudding user response:

I also encountered this problem, to ask, is that code in other machines,

CodePudding user response:

Only a Run - time error '2' error, without any detailed information, is the call of the winsock senddata publishes the event happened when,
 
With Winsock1
RemotePort=2425
The RemoteHost="192.168.1.1"
The Protocol=sckUDPProtocol
. 4923, Bind. LocalIP
. SendData publishes the event "a" '& lt; - the runtime error here
End With

CodePudding user response:

RemoteHost="192.168.1.1" '& lt; - change the name of the machine here also not line,

CodePudding user response:

Control installation is not correct? Register and see, in addition, the Bind (4018) will be port already occupied?

CodePudding user response:

Finally know the reason, is what a SSL VPN before the procedure, lead to more out a network adapter, it is very strange, the name of the "Ethernet adapter {3 f8 a5a d4af999-3226-4-93-6 e02116ee91d}"

Use ipconfig can see, but no corresponding icon in the network connection, should be related to the VPN, the VPN Program after unloading, it's no problem, my VPN Program path is C: \ Program Files \ Sangfor \ SSL \ SangforCSClient,
  • Related