• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 147
  • Last Modified:

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.

0
Engwi
Asked:
Engwi
1 Solution
 
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now