UDP广播的问题
我搞电脑和单片机网口通信,单片机发的数据电脑能收到,电脑发的数据单片机收不到。
我的VB界面如下:
程序如下:
Private Sub CmdSend_Click()
'发送数据
SckServer.SendData TxtSend.Text
End Sub
Private Sub Form_Load()
With SckServer
'.RemoteHost = "192.168.1.30"
'.RemoteHost = "255.255.255.255"
.RemoteHost = "192.168.1.255"
.RemotePort = 8089
.LocalPort = 8089
.Bind 8089
End With
End Sub
Private Sub SckServer_DataArrival(ByVal bytesTotal As Long)
Dim MyStr As String
'得到数据
SckServer.GetData MyStr
'TxtGet.Text = TxtGet.Text & Chr(10) & Chr(13) & MyStr
TxtGet.Text = MyStr
End Sub
请高手看看,VB程序有没有问题?谢谢!