UDP Packets issue !

KZero

Active Member
Licensed User
Longtime User
Hi,

i has problem when i send data from device to other via UDP Socket

when i call UDP.Send(UDPPacket) 20 times (once per 50ms)
it send the 20 packet all in 1ms !!

it make ther other device freeze while receiving all packets in same time :(

i read in the documentation
Send (Packet As UDPPacket)
Sends a Packet. The packet will be sent in the background (asynchronously).

is this the problem ? if so how to fix this issue i spent too much time to determine that the problem in the socket

thanks
 

qsrtech

Active Member
Licensed User
Longtime User
more code?

It's kinda hard to tell how you're sending this packet every 50ms w/o some implementation code. You say it sends it all in 1ms. I assume you have some form of delay timer? Let's assume your using a timer set to 50 (i.e. 50ms). Are you saying the timer loops 20 times before sending the data all together, and this happens all within 1ms?
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
It's kinda hard to tell how you're sending this packet every 50ms w/o some implementation code. You say it sends it all in 1ms. I assume you have some form of delay timer? Let's assume your using a timer set to 50 (i.e. 50ms). Are you saying the timer loops 20 times before sending the data all together, and this happens all within 1ms?

i'm working on Cross-Platform VOIP app
the client must send ~20 packet per second , so i need ~50ms delay between each packet
its not exactly 50ms sometimes its ~30 other times its 60~ i know it depends on many things

but the problem now with the Android Client that when i call UDP.Send it don't excute and send the packet immediately

it look likes it send the whole packets after about 500ms , so from the server side i see that 10 packets arrived at once or in very small time

i hope i could explain the problem :sign0085:
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
Can you post the relevant code?

sub process_globals
Dim TMRSend As Timer
end sub

sub service_create
TMRSend.Initialize("TMRSend",50)
TMRSend.Enabled=True
end sub

sub TMRSend_Tick
Dim B(64) As Byte
B=..........

Dim AudioPacket As UDPPacket
AudioPacket.Initialize (B,"197.134.119.37", 33051)
UDPS.Send (AudioPacket)
end sub
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
In UDP communication with GSM module there is a "PacketSize" configuration. You send data, but they are held until PacketSize has reached.
So if Packetsize is 100 for example and you send strings of 10 bytes, only after 10 strings the whole packet is sent.
I don't know this library, but maybe what I wrote is a hint for you.
Marco
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
In UDP communication with GSM module there is a "PacketSize" configuration. You send data, but they are held until PacketSize has reached.
So if Packetsize is 100 for example and you send strings of 10 bytes, only after 10 strings the whole packet is sent.
I don't know this library, but maybe what I wrote is a hint for you.
Marco

i',m using Speex not GSM and i'm already trying to handle it from the server side but i hope i can fix it from the android side

thx
 
Upvote 0
Top