Click here to Skip to main content
15,905,913 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Following code is already running. No any errors.

Actually, we have multiple devices in fields.
Each device has own GPRS Modem.
All devices are sent data over GPRS network using this modem.
In PC side one application (above written some code) using UDP protocol to get the data from GPRS server.

My question is that when more than 5 devices are sent data at a time no difference in time to send data over GPRS server than many data are lost and discarded.

PC side application can not receive all device data.
Can you suggest me what can I do for receiving all data which are sent at a time?

VB
Private sub ReceiveServer()
  While 1=1
    try
       '--- Receiving Method
       If client.Client.Available > 0 Then
	  mintGPRSPort = CInt(RemoteIpEndPoint.Port.ToString)
          ReDim bytes(0)
	  bytes = client.Receive(RemoteIpEndPoint)
	  clientdata = ""
       	  clientdata = Encoding.ASCII.GetString(bytes).Trim
          debug.print(clientdata)
       end if
   Catch ex As Exception
      Call LogError("ControlInterface.clsGPRS", "DataRequest", Err.Number, ex.Message, ex.StackTrace)
    End Try
  end while
end sub


Thanks...
Posted
Updated 19-May-10 1:32am
v2

Switch to TCP so you have a reliable transport.
 
Share this answer
 
I think u are not using Asynchronous UDP sockets.,

use the Asynchronous UDP sockets to avoid the data loss

A Chat Application Using Asynchronous UDP sockets[^]

go through the above link for Asynchronous UDP sockets.


-------------------------

why are u going for udp , use the TCP communication which is more reliable. my suggestion is use the TCP communication for GPRS communications.

Thanks.
 
Share this answer
 
you can try udx(tcp-over-udp)

www.goodudx.com
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900