public void rtmptConnect(string[] c_params) { PersistantHTTPConnection connection = new PersistantHTTPConnection(sParams.ServerURL, sParams.Port); req = (HttpWebRequest)WebRequest.Create( "http://" + sParams.ServerURL + ":" + sParams.Port + "/send/" + clientIndex + "/" + pollCount ); req.ContentType = "application/x-fcs"; req.Method = "POST"; req.KeepAlive = true; //using the client index connect to the application AMFHeader header = new AMFHeader(AMFHeader.HEADER_12, 0x3); header.EndPoint = 0; header.TimeStamp = 1; header.RTMPType = AMFHeader.RTMP_TYPE_FUNCTION; header.BodySize = 0; requestStream = req.GetRequestStream(); //write the method name (connect); AMFString aString = new AMFString("connect"); aString.write(buffer); buffer.Write(reserved1, 0, reserved1.Length); AMFObject aConnParams = new AMFObject(); aConnParams.addParameter("app", new AMFString(sParams.ApplicationName)); aConnParams.addParameter("flashVer", new AMFString("WIN 8,0,24,0")); aConnParams.addParameter("swfUrl", new AMFString("xfile://c:\\swfurl.swf")); aConnParams.addParameter("tcUrl", new AMFString("rtmp://" + sParams.ServerURL + "/" + sParams.ApplicationName)); aConnParams.addParameter("fpad", new AMFBoolean(false)); aConnParams.addParameter("name", new AMFString("ePresence")); aConnParams.write(buffer); foreach (string s in c_params) { new AMFString(s).write(buffer); } header.BodySize = (int)buffer.Position; Console.Write(header.BodySize); header.writeHeader(requestStream); requestStream.Write(buffer.GetBuffer(), 0, (int)buffer.Position); resp = (HttpWebResponse)req.GetResponse(); responseReader = new StreamReader(resp.GetResponseStream(), Encoding.UTF8); Console.WriteLine(responseReader.ReadToEnd()); }