Jump to content

UDPRecv(), large data to receive


Toady
 Share

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...