Ejemplo n.º 1
0
        /// <summary>
        /// Starts a new service under a given host, port and sub-path, using a transport and protocol that were previously
        /// Registered under a certain name
        /// </summary>
        /// <param name="host">Host where the service is running</param>
        /// <param name="port">Port where the service is running</param>
        /// <param name="path">Sub-Path on the host where the service is accessed</param>
        /// <param name="transportName">Name of the transport that should be used for communication with this service</param>
        /// <param name="protocolName">Name of the protocol that should be used for communication with this service</param>
        /// <returns></returns>
        public ServiceImplementation StartService(string host, int port, string path, string transportName, string protocolName)
        {
            ServiceImplementation service       = new ServiceImplementation(Context.DefaultContext);
            ServiceDescription    serviceServer =
                Context.DefaultContext.StartServer(host, port, transportName, protocolName, ServerConfigDocument, service.HandleNewClient);

            ServerConfigDocument.servers.Add(serviceServer);
            return(service);
        }
        /// <summary>
        /// Constructs a LocalServerImpl object.
        /// </summary>
        public LocalServerImpl()
        {
            dor = new EmptyDoR();
            doi = new EmptyDoI();
            syncID = Guid.NewGuid();

            server = new SINFONIServer(SINFONIServerManager.Instance.ServerURI,
                SINFONIServerManager.Instance.ServerPort,
                "/serversync/",
                "serverSync.kiara");

            Configuration serverSyncConfig = ConfigurationManager.OpenExeConfiguration(this.GetType().Assembly.Location);
            int syncPort = int.Parse(serverSyncConfig.AppSettings.Settings["serverSyncPort"].Value);
            service = server.StartService(SINFONIServerManager.Instance.ServerURI, syncPort, "/", "ws", "fives-json");
            service.OnNewClient += ServerSyncTools.ConfigureJsonSerializer;

            RegisterSyncIDAPI(service);
        }
Ejemplo n.º 3
0
 public static ServiceImplementation Create()
 {
     ServiceImplementation service = new ServiceImplementation(Context.DefaultContext);
     return service;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Starts a new service under a given host, port and sub-path, using a transport and protocol that were previously
 /// Registered under a certain name
 /// </summary>
 /// <param name="host">Host where the service is running</param>
 /// <param name="port">Port where the service is running</param>
 /// <param name="path">Sub-Path on the host where the service is accessed</param>
 /// <param name="transportName">Name of the transport that should be used for communication with this service</param>
 /// <param name="protocolName">Name of the protocol that should be used for communication with this service</param>
 /// <returns></returns>
 public ServiceImplementation StartService(string host, int port, string path, string transportName, string protocolName)
 {
     ServiceImplementation service = new ServiceImplementation(Context.DefaultContext);
     ServiceDescription serviceServer =
         Context.DefaultContext.StartServer(host, port, transportName, protocolName, ServerConfigDocument, service.HandleNewClient);
     ServerConfigDocument.servers.Add(serviceServer);
     return service;
 }
Ejemplo n.º 5
0
        private void InitializeSINFONI()
        {
            clientService = SINFONIServerManager.Instance.SinfoniService;

            string clientManagerIDL = File.ReadAllText("clientManager.kiara");
            SINFONIPlugin.SINFONIServerManager.Instance.SinfoniServer.AmendIDL(clientManagerIDL);
        }
Ejemplo n.º 6
0
        public static ServiceImplementation Create()
        {
            ServiceImplementation service = new ServiceImplementation(Context.DefaultContext);

            return(service);
        }
Ejemplo n.º 7
0
 private void StartSinfoniServer()
 {
     SinfoniServer = new SINFONIServer(ServerURI, ServerPort, ServerPath, "fives.kiara");
     SinfoniService = SinfoniServer.StartService(ServiceHost, ServicePort, "/service/", ServiceTransport, ServiceProtocol);
 }