public MemoryCachingHTTPListener(int initial, int growBy, IHTTPListener listener) { if (listener != null) { this.listener = listener; } }
public void addListener(IHTTPListener listener) { if (!listeners.Contains(listener)) { listeners.Add(listener); } }
public void removeListener(IHTTPListener listener) { if (listeners.Contains(listener)) { listeners.Remove(listener); } }
public MarshalledHTTPListener(MonoBehaviour context, IHTTPListener inner) { if (context == null || inner == null) { throw new HTTPException("Marshalled listener requires a MonoBehaviour and a delegate listener."); } this.inner = inner; this.context = context; start(); }
public override void OnProgress(byte[] data, int bytesRead, int bytesReceived, int bytesExpected) { IHTTPListener listener = getEffectiveListener(); if (listener != null) { UnityThreadHelper.Dispatcher.Dispatch(delegate { listener.OnProgress(this, data, bytesRead, bytesReceived, bytesExpected); }); } }
public override void OnSuccess(IHTTPResponse response) { IHTTPListener listener = getEffectiveListener(); if (listener != null) { UnityThreadHelper.Dispatcher.Dispatch(delegate { listener.OnSuccess(this, response); }); } }
public override void OnComplete() { IHTTPListener listener = getEffectiveListener(); if (listener != null) { UnityThreadHelper.Dispatcher.Dispatch(delegate { listener.OnComplete(this); }); } }
public override void OnError(IHTTPResponse response, Exception exception) { IHTTPListener listener = getEffectiveListener(); if (listener != null) { UnityThreadHelper.Dispatcher.Dispatch(delegate { listener.OnError(this, response, exception); }); } }
public virtual void OnProgress(byte[] data, int bytesRead, int bytesReceived, int bytesExpected) { IHTTPListener effectiveListener = getEffectiveListener(); if (effectiveListener != null) { try { effectiveListener.OnProgress(this, data, bytesRead, bytesReceived, bytesExpected); } catch (Exception exception) { Debug.LogError("A listener threw an exception."); Debug.LogException(exception); } } }
public virtual void OnError(IHTTPResponse response, Exception exception) { IHTTPListener effectiveListener = getEffectiveListener(); if (effectiveListener != null) { try { effectiveListener.OnError(this, response, exception); } catch (Exception exception2) { Debug.LogError("A listener threw an exception."); Debug.LogException(exception2); } } }
public virtual void OnComplete() { IHTTPListener effectiveListener = getEffectiveListener(); if (effectiveListener != null) { try { effectiveListener.OnComplete(this); } catch (Exception exception) { Debug.LogError("A listener threw an exception."); Debug.LogException(exception); } } }
public override void perform(IHTTPListener inner) { inner.OnProgress(request, data, bytesRead, bytesReceived, bytesExpected); }
public override void perform(IHTTPListener inner) { inner.OnStart(request); }
public abstract void perform(IHTTPListener inner);
public override void perform(IHTTPListener inner) { inner.OnComplete(request); }
public override void perform(IHTTPListener inner) { inner.OnSuccess(request, response); }
internal virtual IHTTPListener getEffectiveListener() { IHTTPListener iHTTPListener = getListener(); return((iHTTPListener != null) ? iHTTPListener : getClient().getListener()); }
public override void perform(IHTTPListener inner) { inner.OnError(request, response, exception); }
public void setListener(IHTTPListener listener) { this.listener = listener; }