Win NT Service Application TCPClient, data transfer

Posted on 2006-04-26
Last Modified: 2010-04-05

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.

Question by:Engwi
    1 Comment
    LVL 28

    Accepted Solution

    well, best of best way is to use some sort of CRC. so you change your protocol to something like this:

    on client sice:
    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

    "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 ;) )

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now