i was looking for a way to send file through Socket on C# but i was not lucky to find sample code or …
as you know in Socket we should send an array of byte and array length is MaxInt and a file is larger than MaxInt.
is there a way to send a FileStream through windows Socket on C# ?
i was looking for a way to send file through Socket on C# but
Share
Read the file in chunks (for example 64KB at once). Send each chuck individually. That allows you to stream arbitrarily large files.
Starting with .NET 4.0 you can use
Stream.CopyTo(Stream)to make this a one-liner.