c# - TcpClient / TcpListener filename -
i'm implementing simple file sending method based on example found here, i'm having trouble finding reference on how go sending filename and/or type before sending actual bytes. examples i've seen, manually set filename on receiving end.
my thought far sending separately string, curious if i'm missing easier/convenient way of doing this. so, there method within tcpclient/tcplistener send filename i've missed? there common way of doing haven't run across?
if necessary can post code well.
all can send "data", flat array of bytes. need use kind of protocol both sender , listener apply data.
you want transfer "two blocks of data", in case could:
- send size of each block, followed actual data, followed next block size , data, or:
- use separator character (which works if actual data not contain separator (and there solutions escaping separator in data))
alternatively format data, instance sending xml document, containing:
<mydata> <filename>txt.txt</filename> <data>f83ba=</data> </mydata>
the problem being of course file contents have encoded in order xml validated (base64 encoding example).
Comments
Post a Comment