예제 #1
0
 /// <summary>
 /// Creates an instance of the Woopsa server adding multiRequestHandler and SubscriptionService
 ///
 /// It will automatically create the required HTTP server
 /// on the specified port and will prefix woopsa verbs with the specified
 /// route prefix. It will also add all the necessary native extensions for
 /// Publish/Subscribe and Mutli-Requests.
 /// </summary>
 /// <param name="root">The root object that will be published via Woopsa.</param>
 /// <param name="port">The port on which to run the web server</param>
 /// <param name="routePrefix">
 /// The prefix to add to all routes for woopsa verbs. For example, specifying
 /// "myPrefix" will make the server available on http://server/myPrefix
 /// </param>
 public WoopsaServer(WoopsaObject root, int port = DefaultPort, string routePrefix = DefaultServerPrefix) :
     this((IWoopsaContainer)root, port, routePrefix)
 {
     new WoopsaMultiRequestHandler(root, this);
     _subscriptionService = new WoopsaSubscriptionService(this, root);
     _subscriptionService.CanReconnectSubscriptionToNewObject += OnCanWatch;
 }
예제 #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         ShutDown();
         RemoveRoutes();
         if (_subscriptionService != null)
         {
             _subscriptionService.Dispose();
             _subscriptionService = null;
         }
         if (_isWebServerEmbedded)
         {
             WebServer.Dispose();
             WebServer = null;
         }
     }
 }
예제 #3
0
 /// <summary>
 /// Creates an instance of the Woopsa server adding multiRequestHandler and SubscriptionService
 /// 
 /// It will automatically create the required HTTP server
 /// on the specified port and will prefix woopsa verbs with the specified 
 /// route prefix. It will also add all the necessary native extensions for 
 /// Publish/Subscribe and Mutli-Requests.
 /// </summary>
 /// <param name="root">The root object that will be published via Woopsa.</param>
 /// <param name="port">The port on which to run the web server</param>
 /// <param name="routePrefix">
 /// The prefix to add to all routes for woopsa verbs. For example, specifying
 /// "myPrefix" will make the server available on http://server/myPrefix
 /// </param>
 public WoopsaServer(WoopsaObject root, int port = DefaultPort, string routePrefix = DefaultServerPrefix)
     : this((IWoopsaContainer)root, port, routePrefix)
 {
     new WoopsaMultiRequestHandler(root, this);
     _subscriptionService = new WoopsaSubscriptionService(this, root);
 }