Otp.AbstractConnection.sendStatus C# (CSharp) Method

sendStatus() protected method

protected sendStatus ( System status ) : void
status System
return void
        protected internal virtual void  sendStatus(System.String status)
        {
            
            OtpOutputStream obuf = new OtpOutputStream();
            obuf.write2BE(status.Length + 1);
            obuf.write1(ChallengeStatus);
            //UPGRADE_NOTE: This code will be optimized in the future;
            byte[] tmpBytes;
            int i;
            string tmpStr;
            tmpStr = status;
            tmpBytes = new byte[tmpStr.Length];
            i = 0;
            while (i < tmpStr.Length)
            {
                tmpBytes[i] = (byte) tmpStr[i];
                i++;
            }
            obuf.write(tmpBytes);
            
            obuf.writeTo((System.IO.Stream) socket.GetStream());
            
            if (traceLevel >= OtpTrace.Type.handshakeThreshold)
            {
                OtpTrace.TraceEvent("-> " + "HANDSHAKE sendStatus" + " status=" + status + " local=" + self);
            }
        }