protected virtual Command ReadConnected()

in src/main/csharp/Protocol/StompWireFormat.cs [223:273]


        protected virtual Command ReadConnected(StompFrame frame)
        {
            this.remoteWireFormatInfo = new WireFormatInfo();

            if(frame.HasProperty("version"))
            {
 				remoteWireFormatInfo.Version = Single.Parse(frame.RemoveProperty("version"), 
				                                            CultureInfo.InvariantCulture);
                if(remoteWireFormatInfo.Version > 1.0f)
                {
                    this.encodeHeaders = true;
                }

                if(frame.HasProperty("session"))
                {
                    remoteWireFormatInfo.Session = frame.RemoveProperty("session");
                }

                if(frame.HasProperty("heart-beat"))
                {
                    string[] hearBeats = frame.RemoveProperty("heart-beat").Split(",".ToCharArray());
                    if(hearBeats.Length != 2)
                    {
                        throw new IOException("Malformed heartbeat property in Connected Frame.");
                    }

                    remoteWireFormatInfo.WriteCheckInterval = Int32.Parse(hearBeats[0].Trim());
                    remoteWireFormatInfo.ReadCheckInterval = Int32.Parse(hearBeats[1].Trim());
                }
            }
            else
            {
                remoteWireFormatInfo.ReadCheckInterval = 0;
                remoteWireFormatInfo.WriteCheckInterval = 0;
                remoteWireFormatInfo.Version = 1.0f;
            }

            if(this.connectedResponseId != -1)
            {
                Response answer = new Response();
                answer.CorrelationId = this.connectedResponseId;
                SendCommand(answer);
                this.connectedResponseId = -1;
            }
            else
            {
                throw new IOException("Received Connected Frame without a set Response Id for it.");
            }

            return remoteWireFormatInfo;
        }