Board index » delphi » TServerSocket

TServerSocket

I have a program that receive sock connections, but if I send file bigger than 8K, the program receive just 8k, I am using the object TServerSocket:
TServerSocket.Socket.ReceiveBuff(VPac,tampac).

The packet that has been transfered has a header and a body, the header has information about the packet, like size of all packet, and the body is data that have to be transfered.
How can I receive all packet?
Have I to use TServerClientThread? How Can I use it?
Thanks for help.

 

Re:TServerSocket


You have to split the data that you want to send and make some consecutive
sends.
Then you can put the data back together on the other side

Andy

Re:TServerSocket


You can never assume that all data will be sent or received in a single
block.
Have a header with a set size and keep reading until you're sure the header
is received at least. Get packet size from the header then keep reading
until all the data expected arrives or theres an error or timeout.

Quote
"Louren?o" <lourenc...@cnp.com.br> wrote in message

news:3c10c91f$1_2@dnews...
Quote

> I have a program that receive sock connections, but if I send file bigger

than 8K, the program receive just 8k, I am using the object TServerSocket:
Quote
> TServerSocket.Socket.ReceiveBuff(VPac,tampac).

> The packet that has been transfered has a header and a body, the header

has information about the packet, like size of all packet, and the body is
data that have to be transfered.
Quote
> How can I receive all packet?
> Have I to use TServerClientThread? How Can I use it?
> Thanks for help.

Other Threads