How to recieve UDP packet as client
Well, I'm making a bot for multiplayer game. Game works on both protocol - TCP and UDP. I did the TCP part, but I'm having problems with UDP now. I know I don't need to connect Winsock cuz UDP protocol is conectionless, but how do I do this then?
So, considering my app is client, how will it receive UDP packets from server if it does not connect?
More precisely, I need my app to send back every UDP packet it receives. This is what I tried, but I guess there's something wrong with this, cuz it does not receive any packet.
Code:
Private Sub Command2_Click()
Winsock3.RemoteHost = Text2.Text
Winsock3.RemotePort = Text3.Text
End Sub
Code:
Private Sub Winsock3_DataArrival(ByVal bytesTotal As Long)
Dim UDPPacket() As Byte
Winsock3.GetData UDPPacket
Winsock3.SendData UDPPacket
End Sub
Re: How to recieve UDP packet as client
This is duplicate post... I clicked the button to post before I finished, by accident. I don't know how to delete this now -.-
Re: How to recieve UDP packet as client
Listen:
Code:
Option Explicit
Private Sub Form_Load()
Sock.LocalPort = 10101
Sock.Protocol = sckUDPProtocol
Sock.Bind
End Sub
Private Sub Sock_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
Sock.GetData Data
MsgBox Data
End Sub
Send Data:
Code:
Option Explicit
Private Sub Form_Load()
Sock.RemoteHost = "127.0.0.1"
Sock.RemotePort = 10101
Sock.Protocol = sckUDPProtocol
Sock.SendData "Boo!"
End Sub
Re: How to recieve UDP packet as client
Re: How to recieve UDP packet as client
Quote:
Well, I'm making a bot for multiplayer game
Our terms of service expressly prohibit questions on how to violate any third parties terms of service. Unless the third party game in question allows the use of bots then this is not a topic we would want discussed.
Which game is this for?
Re: How to recieve UDP packet as client
Quote:
Originally Posted by
MadLover68
Hello, will you help me?
A package I caught with Wpe pro
I want to add a project
Start your own thread.
The is second post in an existing thread with a complete different subject.