Toady Posted August 23, 2007 Share Posted August 23, 2007 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 More sharing options...
weaponx Posted August 23, 2007 Share Posted August 23, 2007 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 More sharing options...
Toady Posted August 23, 2007 Author Share Posted August 23, 2007 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 More sharing options...
weaponx Posted August 23, 2007 Share Posted August 23, 2007 (edited) 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 August 23, 2007 by weaponx Link to comment Share on other sites More sharing options...
Toady Posted August 23, 2007 Author Share Posted August 23, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now