Win NT Service Application TCPClient, data transfer

Greetings,

What is the best way to ensure that a string sent to my service application gets transferred properly.

I have TIDTcpClients connecting to a service application that resides on the intranet of our client.
The service application with a TServerSocket listening on port 555 where it will read incoming data
with the "ServerSocketClientRead" event.

All is well, but due to heavy traffic on the network at times, it happens that some records never gets
to my database (SQL server 2000)

What is the best method of enuring that data was received and the record inserted into my DB ?

Would also increase the pts for some pointers on best practices wrt implementing a caching macility
in the event where data cannot be transferred.

Thanks in advance.

EngwiAsked:
Who is Participating?
 
2266180Commented:
well, best of best way is to use some sort of CRC. so you change your protocol to something like this:

on client sice:
repeat
start send
- send packet size
- send packet
- send packet crc
end send
read status
until status=ok

on server side:
start receive
- read packet size
- read packet: validate packet size to be the one sent
- read crc: validate packet to have good crc
end receive
write status

regarding:
"Would also increase the pts for some pointers on best practices wrt implementing a caching macility
in the event where data cannot be transferred."

could you rephrase? :)

if you are thinking of doing caching for the inital problem, forget it: caching is done when you don't want to send over the same that the client/server already has. and caching is done on receiving end (and since it didn't go through, there is nothing to cache ;) )
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.