public WebRequest(string url) { // parse url url = GetUrl(url); _url = url; _uri = new EB.Uri(url); _method = "GET"; }
public static Network Create(string url) { var uri = new EB.Uri(url); System.Type type = null; if (_types.TryGetValue(uri.Scheme, out type)) { return((Network)System.Activator.CreateInstance(type)); } throw new System.Exception("Uknown network type: " + uri.Scheme); }
public WebRequest(string url, Hashtable headers) { // parse url url = GetUrl(url); _url = url; _uri = new EB.Uri(url); _method = "GET"; foreach (DictionaryEntry header in headers) { _requestHeaders[header.Key.ToString()] = header.Value.ToString(); } }
// token for the websocket public WebSocketEndPoint(string endPoint, EndPointOptions options) : base(MakeHttpEndpoint(endPoint), options) { _wsUrl = new EB.Uri(endPoint); _socket = new Net.TalkWebSocket(); _socket.ActivityTimeout = options.ActivityTimeout; _socket.OnError += OnError; if (options.KeepAlive) { ConnectIfNeeded(); } }
static StackObject *get_Host_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); EB.Uri instance_of_this_method = (EB.Uri) typeof(EB.Uri).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.Host; return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
static StackObject *Ctor_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.String @url = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = new EB.Uri(@url); return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
public MasterServer(object data) { EndPoint = Dot.String("endpoint", data, string.Empty); Token = Dot.String("token", data, string.Empty); Name = Dot.String("name", data, string.Empty); PingPort = Dot.Integer("pingPort", data, 0); Ping = 0; // unknown if (!string.IsNullOrEmpty(EndPoint)) { Hostname = new EB.Uri(EndPoint).Host; } Games = new MasterServerGame[0]; }
void OnGetPushToken(string error, Hashtable result) { var websocket = Dot.String("websocket", result, string.Empty); if (!string.IsNullOrEmpty(websocket)) { _url = new EB.Uri(websocket); State = SubSystemState.Connected; ConnectWebsocket(); } else { State = SubSystemState.Error; } }
public override void Initialize(Config config) { _api = new PushAPI(Hub.ApiEndPoint); _deffered = new Deferred(4); _url = null; #if UNITY_IPHONE UnityEngine.iOS.NotificationServices.ClearLocalNotifications(); UnityEngine.iOS.NotificationServices.ClearRemoteNotifications(); EB.Debug.Log("PushManager: registering for notification services"); UnityEngine.iOS.NotificationServices.RegisterForNotifications(UnityEngine.iOS.NotificationType.Alert | UnityEngine.iOS.NotificationType.Badge | UnityEngine.iOS.NotificationType.Sound); #elif UNITY_ANDROID #endif }
public WebRequest(string url, byte[] postData, Hashtable headers) { // parse url url = GetUrl(url); _url = url; _uri = new EB.Uri(url); _method = "POST"; foreach (DictionaryEntry header in headers) { _requestHeaders[header.Key.ToString()] = header.Value.ToString(); } _requestHeaders["Content-Length"] = postData.Length.ToString(); _body = postData; _bytesSent = postData.LongLength; }
public Request(string url, bool isPost) { _url = new EB.Uri(url); _isPost = isPost; numRetries = 0; suspendMethod = eSuspendMethod.Retry; _query = QueryString.Parse(_url.Query); if (isPost) { _data = Johny.HashtablePool.Claim(); } else { _data = _query; } }
public Manager(Config config) { if (Enabled == true) { _config = config; _rpcs = Johny.HashtablePool.Claim(); _deferred = new EB.Deferred(8); _updateHandle = EB.Coroutines.SetUpdate(_deferred.Dispatch); // load certs //EB.Net.TcpClientFactory.LoadCertStore("Crypto/Certs"); // make the signed request Hashtable data = Johny.HashtablePool.Claim(); data["_id"] = EB.Version.GetMACAddress(); data["type"] = Application.platform.ToString(); data["game"] = _config.game; data["last"] = EB.Time.Now; data["algorithm"] = "hmac-sha1"; var json = EB.JSON.Stringify(data); var key = SignedRequest.Stringify(Encoding.GetBytes(json), Hmac.Sha1(Encoding.GetBytes(_config.serverKey))); var url = _config.serverUrl + "?access_token=" + key; _wsUrl = new EB.Uri(url); Debug.Log("GameTalk Url: " + url); _socket = new EB.Net.TalkWebSocket(); _socket.OnError += this.OnError; _socket.OnRPC += this.OnRPC; Bind(string.Empty, new RPC.Global()); ConnectIfNeeded(); } }