background:

i made a simple tcp/ssl send/receive client/server using fpc/synapse

i started off using sendstring/recvpacket for sending stuff but while it works 
okay for simple typing text and text files and fpc runcommand results it gave 
bad 'binary' files (tgz png pdf etc)

so since going through
http://synapse.ararat.cz/doc/help/blcksock.TBlockSocket.html
was a bit overkill for information to use to figure out what to use

so looking around for a solution and finding
https://forum.lazarus.freepascal.org/index.php?topic=31488.0
https://stackoverflow.com/questions/30778703/lazarus-freepascal-synapse-send-file-to-tcpblocksocket

so now i use sendstreamraw(fs); // tstreamemory  for sending 'binary' files
and everything is fine

---

my question:

since the most common use of the program will be sending text files and using 
the sendstreamraw method with tfilestream works just as well as sendstring 
(from working vs not working viewpoint only) and thinking on simplifying the 
code to just use sendstreamraw for sending text files (treating all files as a 
single class of files rather then as text vs binary)

is creating the tfilestream then using sendstreamraw
fs := tfilestream.create(s, fmOpenRead);
a more or less efficient method then just reading the file into a variable and 
then using sendstring

any information on limitations/benefits/synapse internals/fpc compiler 
internals/timing  etc of using the sendstreamraw vs sendstring methods would be 
appreciated

---


_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to