public static void Main(string[] args) { var service = new TcpRemoteServiceHost <QueryCoordinatorServiceConnection>(args); service.Start(); service.Instance.Dispose(); }
public static void Main(string[] args) { var serviceArguments = ParseArguments(args); var started = serviceArguments.Length; var autoReset = new AutoResetEvent(false); foreach (var s in serviceArguments) { switch (s.Type) { case ReactiveServiceType.MetadataService: { var service = new TcpRemoteServiceHost <StorageConnection>(new[] { s.Port, s.Uri }); Start(service, autoReset, --started); break; } case ReactiveServiceType.QueryCoordinator: { var service = new TcpRemoteServiceHost <QueryCoordinatorServiceConnection>(new[] { s.Port, s.Uri }); Start(service, autoReset, --started); break; } case ReactiveServiceType.QueryEvaluator: { var service = new TcpRemoteServiceHost <QueryEvaluatorServiceConnection>(new[] { s.Port, s.Uri }); Start(service, autoReset, --started); break; } case ReactiveServiceType.MessagingService: { var service = new TcpRemoteServiceHost <MessagingConnection>(new[] { s.Port, s.Uri }); Start(service, autoReset, --started); break; } case ReactiveServiceType.StateStoreService: { var service = new TcpRemoteServiceHost <StateStoreConnection>(new[] { s.Port, s.Uri }); Start(service, autoReset, --started); break; } case ReactiveServiceType.KeyValueStoreService: { var service = new TcpRemoteServiceHost <KeyValueStoreConnection>(new[] { s.Port, s.Uri }); Start(service, autoReset, --started); break; } case ReactiveServiceType.DeployerService: default: throw new NotSupportedException( string.Format(CultureInfo.InvariantCulture, "Service type '{0}' is not supported.", s.Type)); } } }
private static void Start <T>(TcpRemoteServiceHost <T> service, AutoResetEvent autoReset, int count) where T : new() { if (count > 0) { autoReset.Set(); service.Start(autoReset); } else { service.Start(autoReset); } }
public static void Main(string[] args) { var service = new TcpRemoteServiceHost <StateStoreConnection>(args); service.Start(); }