WebRTC_Sample.SessionForm.GetOffer C# (CSharp) Method

GetOffer() public method

public GetOffer ( ) : WebRTCCommons.CustomAwaiter
return WebRTCCommons.CustomAwaiter
        public WebRTCCommons.CustomAwaiter<string> GetOffer()
        {
            WebRTCCommons.CustomAwaiter<string> retVal = new WebRTCCommons.CustomAwaiter<string>();
            GetOfferAsync(retVal);
            return (retVal);
        }

Usage Example

示例#1
0
        private void GetNewPassivePOC(WebRTCCommons.CustomAwaiter <byte[]> awaiter)
        {
            BeginInvoke((Action <WebRTCCommons.CustomAwaiter <byte[]> >)(async(a) =>
            {
                SessionForm f = new SessionForm();
                if (StunServersInUse)
                {
                    f.SetStunServers(false, StunServers);
                }
                f.FormClosing += SessionFormClosing;
                f.Show(this);

                userForms.Add("/" + f.Value.ToString(), f);

                string content = passiveHtmlpage.Replace("/*{{{ICESERVERS}}}*/", "").Replace("{{{OFFER_URL}}}", "127.0.0.1:" + mServer.Port.ToString() + "/" + f.Value.ToString());
                string sdp     = await f.GetOffer();

                content = content.Replace("/*{{{SDP}}}*/", System.Convert.ToBase64String(UTF8Encoding.UTF8.GetBytes(sdp)));

                string header = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nConnection: close\r\nContent-Length: " + content.Length.ToString() + "\r\n\r\n";
                a.SetComplete(UTF8Encoding.UTF8.GetBytes(header + content));
            }), awaiter);
        }
All Usage Examples Of WebRTC_Sample.SessionForm::GetOffer