.net - Http Web Server - big response packet issue C# -


I'm creating an HTTP web server primarily for an uptime uptime monitor, but wanted to expand it more It has more general use. One problem is that when a customer requests for an image (for example) 1 MB +, then I do not know how to split image data to fit within the MTU size of the pack.

Below is the data that I am using to send data. (StreamWriter AutoFlush is enabled)

  Send Private Zero (Stream Stream, String File Location, bool useGzip, String contentType, String ResponseLine, bool CloseConnection, String Server) {writer.Write (ResponseLine + "/ R / n"); Author. Type ("server:" + server + "/ r / n"); If (CloseConnection == true) the author Write ("connection: keep-alive" + "/ r / n"); // if (useGzip == true) / write ("connection: close" + "/" / r / n "); Writer (Writer: "Content-Type:" + contentType + "/ r / n"); Writer. ("Content-Length:" + Stream + Longer + "/ Author / WrightLine (" Content-Encoding: gzip "). Write ("" + "/ R / N"); Byte [] data = new byte [stream] .Length]; Read the stream (data, 0, data. Lang); writer.Write (data); writer.Flush ();}  

In addition, Is there a way to split large responses into multiple packets without TCP split in HTTP?

Resolve - TcpClient, Capture more than 500 sized packets in Yorkhair, or TCP segment is shown. Using a socket instead of class, a task is performed and removes the stream overlay (BinaryReader / BinaryWriter)

You should not care because TCP Sockets will do this automatically TCP sections are not limited by MTO and there is no reason to not use sockets.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -