docs.unity3d.com
    Show / Hide Table of Contents

    Class HttpHostingService

    HTTP implementation of hosting service.

    Inheritance
    Object
    BaseHostingService
    HttpHostingService
    Inherited Members
    BaseHostingService.Logger
    BaseHostingService.DisambiguateProfileVar(String)
    BaseHostingService.DescriptiveName
    BaseHostingService.InstanceId
    BaseHostingService.EvaluateProfileString(String)
    BaseHostingService.LogFormat(LogType, String, Object[])
    BaseHostingService.Log(String, Object[])
    BaseHostingService.LogWarning(String, Object[])
    BaseHostingService.LogError(String, Object[])
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEditor.AddressableAssets.HostingServices
    Syntax
    public class HttpHostingService : BaseHostingService, IHostingService

    Constructors

    Name Description
    HttpHostingService()

    Create a new HttpHostingService

    Properties

    Name Description
    HostingServiceContentRoots

    List of content roots for hosting service.

    HostingServicePort

    The port number on which the service is listening

    IsHostingServiceRunning

    Gets the current running status of the hosting service.

    MyHttpListener

    The actual Http listener used by this service

    ProfileVariables

    Dictionary of profile variables defined by the hosting service.

    UploadSpeed

    The upload speed that files were be served at, in kbps

    Methods

    Name Description
    ConfigureHttpListener()

    Handles any configuration necessary for MyHttpListener before listening for connections.

    Finalize()

    Destroys a HttpHostingService

    FindFileInContentRoots(String)

    Searches for the given relative path within the configured content root directores.

    GetAvailablePort()

    Find an open network listen port on the local system

    HandleRequest(IAsyncResult)

    Asynchronous callback to handle a client connection request on MyHttpListener. This method is recursive in that it will call itself immediately after receiving a new incoming request to listen for the next connection.

    IsPortAvailable(Int32)

    Tests to see if the given port # is already in use

    OnAfterDeserialize(KeyDataStore)

    Called immediatley following a domain reload by the HostingServicesManager, for restoring state information after the service is recreated.

    OnBeforeSerialize(KeyDataStore)

    Called by the HostingServicesManager before a domain reload, giving the hosting service an opportunity to persist state information.

    OnGUI()

    Render the hosting service GUI.

    ResetListenPort(Int32)

    Listen on a new port the next time the server starts. If the server is already running, it will be stopped and restarted automatically.

    Return404(HttpListenerContext)

    Sets the status code to 404 on the given HttpListenerContext object.

    ReturnFile(HttpListenerContext, String, Int32)

    Sends a file to the connected HTTP client

    StartHostingService()

    Starts the hosting service.

    StopHostingService()

    Temporarily stops the service from receiving requests.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023