> Always is needed use the OnDataSent event ? > I need only transfer the tmemorystream off a Timage1 to Timage2 over twsocket.
You may send a huge block of data in one Send call. An entire image if you like. BUT remember TWSocket is asynchronous and transmitting data over the network takes time. You call to the Send method will return almost instantly, way long before the data is actually sent: TWSocket will automatically buffer the data in memory and send it in the background for you. This may take a lot of memory if you send large data. This may be of no importance for your application, or it IS important... When using OnDataSent event, you have control on the size of data that is memorized. For example you can read your stream 4KB (Any value is OK) at a time, send that chunk of data and then read the next chunk from the OnDataSent event, that is the next chunk will be read and put in internal TWSocket buffer only when previous chunk is sent. This is how the HTTP component (both client and server) are working to send data. This way it doesn't matters if a multi GB file is sent. The memory used is always the size of the chunk your application read. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be