The host class. Receives a stream from the HTTP server caller and dispatches the specified server.
Inheritance: MeshServiceProvider
Example #1
0
        // To run, it is necessary to first set permissions (as root)
        // netsh http add urlacl url=http://+:80/.well-known user=VOODOO\Phillip

        // netsh http add urlacl url="http://prismproof.org:80/.well-known/MeshService/" user=VOODOO\Phillip

        /// <summary>
        /// Start the mesh server
        /// </summary>
        /// <param name="Options"></param>
        public override void Start(Start Options) {

            // Create the provider object.
            var MeshServiceProvider = new PublicMeshServiceProvider(Options.Address.Value, 
                Options.MeshStore.Value, Options.PortalStore.Value);


            // Create the server, add the provider, create service port.
            var Server = new JPCServer();
            var HostReg = Server.Add(MeshServiceProvider);

            // Create the interface dispatcher for the provider.
            var Interface = new PublicMeshService(MeshServiceProvider, null);
            var InterfaceReg = HostReg.Add (Interface);

            // Register the network port.
            InterfaceReg.AddService(Options.Address.Value);

            // Run until abort
            Server.RunBlocking();
            }
 /// <summary>
 /// Create new portal using the default stores.
 /// </summary>
 public MeshPortalLocal() {
     MeshServiceHost = new PublicMeshServiceProvider(ServiceName, MeshStore, PortalStore);
     }
 /// <summary>
 /// Initialize the portal
 /// </summary>
 /// <param name="ServiceName">DNS service name</param>
 /// <param name="MeshStore">File name for the Mesh Store.</param>
 /// <param name="PortalStore">File name for the Portal Store.</param>
 protected void Init (string ServiceName, string MeshStore, string PortalStore) {
     this.ServiceName = ServiceName;
     this.MeshStore = MeshStore;
     this.PortalStore = PortalStore;
     MeshServiceHost = new PublicMeshServiceProvider(ServiceName, MeshStore, PortalStore);
     }
 /// <summary>
 /// The mesh service dispatcher.
 /// </summary>
 /// <param name="Host">The service provider.</param>
 /// <param name="Session">The authentication context.</param>
 public PublicMeshService(PublicMeshServiceProvider Host, JPCSession Session) {
     this.Provider = Host;
     Host.Interfaces.Add(this);
     Host.Service = this;
     //this.JPCSession = Session;
     }