Board index » delphi » Are the TClientSocket and TServerSocket componants unreliable?

Are the TClientSocket and TServerSocket componants unreliable?

I have been making a remote administration program using the TClientSocket and TServerSocket componants.  I use the SendText method to send text commands which are parsed at the other end and an appropriate action is exectued.  e.g. RenFile Oldname.txt NewName.Txt renames a file from oldaname.txt to newname.txt.  The weird percent symbol (ascii 137) was chosen at random to specify parametres.
After i started to code commands which would recieve a lot of feedback from the server such as listing a directory, it didnt work because the server seemd to concatenate every sendtext string over a second or so then send them.  This wasnt a big problem because i used another symbol (pipe |) to specify the end of a command.  This works fine but for some reason when recieving a lot of feedback it seems to delete part of the string sent and so the command isnt recognised, and the text being sent dosent contain any of the special characters im using.
Ive read on other messages recently that TClientSocket and TServerSocket are dodgey and i was wondering if this was the cause.
Is this down to the componants, winsock.dll, or my parser routines (i cant see anything wrong with those)?

Thanks   -   James

 

Re:Are the TClientSocket and TServerSocket componants unreliable?


In article <7egmem$fb...@plutonium.btinternet.com>, Jric...@btinternet.com
says...

[snip]

Quote
>I have been making a remote administration program using the =
>TClientSocket and TServerSocket componants.  I use the SendText method =
>to send text commands which are parsed at the other end and an =
>appropriate action is exectued.

[snip]

Quote
>This works fine but for some =
>reason when recieving a lot of feedback it seems to delete part of the =
>string sent and so the command isnt recognised, and the text being sent =
>dosent contain any of the special characters im using.
>Ive read on other messages recently that TClientSocket and TServerSocket =
>are dodgey and i was wondering if this was the cause.

If you get that problem only on win 95 machines, it is most likely caused by a
bug in the recv() API function which can cause data losses. See article Q168187
(go to http://support.microsoft.com/support and search for article ID Q168187)

To minimize the frequency of these errors ensure that your data packets are all
not bigger than 4096 bytes. This calls for added effort, but it worked for me.

Please switch news sending format to plain text, not HTML (in Outlook
XPress go to Tools | Options | Send).

--
Christo Crause
Thermal Separations Research
University of Stellenbosch
South Africa

Other Threads