How to control data write and read efficiently? OR What are the possible reason for decreasing read/write speed? Is there any mistake in my code? Currently it is very slow.
I am using below code:
listener.BeginAcceptTcpClient(new AsyncCallback(AcceptCallback), listener);
.....
// Inside AcceptCallback()
dataStream = client.GetStream();
sslStream = new SslStream(dataStream, true, new RemoteCertificateValidationCallback(ValidateCert));
sslStream.AuthenticateAsServer(serverCertificate);
....
sslState.sslStream.BeginRead(buffer, 0, Length, StartSSLSession, sslState);
// Inside StartSSLSession(IAsyncResult ar)
sslStream.Write(responseBuffer);
sslStream.Flush();
Please give suggestions or solutions..
Here I attached the image of current length of the data transferring from client to server. Is this possible to increase the length of the client data..?