Jump to content
Sign in to follow this  
Toady

UDPRecv(), large data to receive

Recommended Posts

Toady

I'm able to receive data like this....

Local $data = UDPRecv($socket, 512)

Yet thats not all the data I need, there is more that follows, but it seems UDPRecv will only accept (and im guessing) no more than 512 bytes at a time. Or am I just dumb and missing something lol.

Anyone have an example of using UDP in receiving large data size?


www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Share this post


Link to post
Share on other sites
weaponx

I'm able to receive data like this....

Local $data = UDPRecv($socket, 512)

Yet thats not all the data I need, there is more that follows, but it seems UDPRecv will only accept (and im guessing) no more than 512 bytes at a time. Or am I just dumb and missing something lol.

Anyone have an example of using UDP in receiving large data size?

The help file makes it seem like

UDPRecv($socket, 512)

Sets the max character length to 512, are you receiving text or binary?

Why not just set it to like 2048?

Share this post


Link to post
Share on other sites
Toady

The help file makes it seem like

UDPRecv($socket, 512)

Sets the max character length to 512, are you receiving text or binary?

Why not just set it to like 2048?

Help file does not make it seem clear, the example used only shows 50 characters being transfered. I have already tried using numbers greater than 512. Though, no matter what number I choose it still only accepts a certain amount.


www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Share this post


Link to post
Share on other sites
weaponx

Are you transmitting text?

What if you tried sending and receiving as binary:

UDPSend ( $socketarray, StringToBinary("Some Text"))

$data = UDPRecv ( $socketarray, 2048, 1)

BinaryToString ( $data )

Edited by weaponx

Share this post


Link to post
Share on other sites
Toady

well I got it working but not the way I wanted to... I had to create 2 data buffers, one for each 512 bytes of data revieced from server.

Local $data1 = UDPRecv($socket, 512,1)

Local $data2 = UDPRecv($socket, 512,1)

Since,

Local $data = UDPRecv($socket, 1024,1)

doesnt work...


www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.