public ProxyWebSocketConnection(ConnectionOpenedMessage connectionOpenedMessage, ApplicationService applicationService)
 {
     _applicationService = applicationService;
     _identity = connectionOpenedMessage.ConnectionIdentity;
     _host = connectionOpenedMessage.Host;
     _path = connectionOpenedMessage.Path;
 }
        public HostedAppServiceImpl(DeviceHiveConfiguration configuration, Router router)
        {
            var hosting = configuration.WebSocketEndpointHosting;
            if (string.IsNullOrEmpty(hosting.HostPipeName) || string.IsNullOrEmpty(hosting.AppPipeName))
                throw new ConfigurationErrorsException("Please specify hostPipeName and appPipeName in the webSocketEndpointHosting configuration element!");

            _service = new ApplicationService(hosting.HostPipeName, hosting.AppPipeName);
            _service.ConnectionOpened += (s, e) => router.HandleNewConnection(e.Connection);
            _service.MessageReceived += (s, e) => router.RouteRequest(e.Connection, e.Message);
            _service.ConnectionClosed += (s, e) => router.CleanupConnection(e.Connection);
        }
 public ProxyWebSocketConnection(ConnectionOpenedMessage connectionOpenedMessage, ApplicationService applicationService)
 {
     _applicationService = applicationService;
     _identity           = connectionOpenedMessage.ConnectionIdentity;
     _host = connectionOpenedMessage.Host;
     _path = connectionOpenedMessage.Path;
 }