-
Feb 5th, 2017, 09:00 PM
#1
Thread Starter
New Member
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
-
Feb 5th, 2017, 09:10 PM
#2
Thread Starter
New Member
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 -.-
-
Feb 6th, 2017, 03:42 AM
#3
Junior Member
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
-
Feb 6th, 2017, 03:46 AM
#4
Junior Member
Re: How to recieve UDP packet as client
-
Feb 6th, 2017, 08:23 AM
#5
Re: How to recieve UDP packet as client
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?
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Jul 13th, 2018, 02:18 AM
#6
Re: How to recieve UDP packet as client
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|