This is not exactly the answer for my question.
Think of coding the Picture-Data in just readable Ascii-Characters. This
maybe result in a very large string, ended with #13#10. I thought this
result in a single OnDataAvailable-Event where I can read the whole string
with one call to receivestr. I thought TWSocket concats the single parts
until it finds the #13#10 (in linemode of course) and fires a single
Am I wrong?
Naturally this is not a good approach - sending it binary with a special
data-structure is much better.
> >> can someone tell me, how long the result of
> >> the ReceiveStr Function can be?
> > AFAIK, it is limited with packet length.
> ReceiveStr will return at most what can fit into winsock receive buffer
> which default to 8KB if memory serve me well. But if your program is
> responsive, you'll likely never receive more than the largest packet
> which is 1514 bytes on Ethernet.
> >> I mean, are there any limitations or can I send a complete (maybe
> >> acsii-coded) picture (~200kByte) in a String?
> Sending is totally independent of receiving ! TCP has no datagram
> preserved. TWSocket will accept any size in SendStr. No problem to load
> image into a single string and send it in a single call to SendStr. This
> a bad idea, but ot will work. This doesn't mean the receiver will
> a single OnDataAvailable ! Please read "TCP/UDP primer" available from
> "support" page at http://www.overbyte.be for more explanation.
> btw: To send a small image, you'd better load it into an array of bytes
> send it in a single call. For larger images, it is better to read the
> file by chunck (for example 4KB) and send each chunk individually. You
> the next chunk from the OnDataSent event. This way, you have never more
> 4KB in memory and will able to send multi-megabytes or gygabytes of data
> without "using" too much RAM.
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be